I am having a problem creating a parent function that calls different functions within based on conditions. The functions within all take the exact same arguments and return the same set type. This must be a simple mistake on my part, but not sure of the fix. When I try to use a RETURN statement, the following error is given: ERROR: RETURN cannot have a parameter in function returning set ********** Error ********** ERROR: RETURN cannot have a parameter in function returning set So, if I try using RETURN NEXT or the PERFORM statement, the client app says: ERROR: query "SELECT myfunctionB(paccntid,pitemid,pthing)" returned more than one row CONTEXT: PL/pgSQL function mydispatch(integer, integer, text) at RETURN NEXT The individual functions within work fine when called on their own. I just need to fire of one or another based on simple logic. Here is the basic function: -- Function: mydispatch(integer, integer, text) -- DROP FUNCTION mydispatch(integer, integer, text) CREATE OR REPLACE FUNCTION mydispatch( BEGIN IF (condition = true) RETURN myfunctionA(paccntid,pitemid,pthing); END IF; RETURN myfunctionB(paccntid,pitemid,pthing); END; Stefan |