Hello
I thing RETURN QUERY is successful idea. It should be completed withsupport of dynamic SQL.
Syntax:
RETURN EXECUTE sqlstring [USING];
This is shortcut forFOR r IN EXECUTE sqlstring USING LOOP RETURN NEXT r;END LOOP;
RegardsPavel Stehule