In traditional programming there is an axiom that states, "do not use errors for flow control". A general example is to throw an error then catch the error instead of using an ordinary conditional statement or break statement. This is harmful because the application has to unwind the call stack and invoke some relatively expensive exception handling logic versus simply handling a conditional statement.
I am working with a postgres system where a user is calling a function in postgres that throws an error instead of returning no rows when a condition is not met. The condition is roughly a "this input value does not exist, nothing to do" as opposed to a truly exceptional case.
Does postgres incur runtime costs when an error is thrown in a similar manner traditional programming? In other words is using exceptions as flow control in postgres harmful to performance or just sloppy?