Hello I thing RETURN QUERY is successful idea. It should be completed with support of dynamic SQL. Syntax: RETURN EXECUTE sqlstring [USING]; This is shortcut for FOR r IN EXECUTE sqlstring USING LOOP RETURN NEXT r; END LOOP; Regards Pavel Stehule
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных