I have a Postgres function which returns a table "RETURNS TABLE......"
There is some business rules in place in the code. If certain conditions are not met, I want to return just an empty record set. Is there a simple way to do this? Or do I need to select a NULL for each column returned?
Right now if I try to return just NULL, it complains: ERROR: structure of query does not match function result type.
SELECTthat you know does not return anything?