Mega Code Archive

 
Categories / PostgreSQL / Store Procedure Function
 

Two out parameters

postgres=# postgres=# CREATE FUNCTION dup (f1 anyelement, OUT f2 anyelement, OUT f3 anyarray) postgres-# AS 'select $1, array[$1,$1]' LANGUAGE sql; CREATE FUNCTION postgres=# postgres=# SELECT * FROM dup(22);     REATE  f2 |   f3 ----+---------  22 | {22,22} (1 row) postgres=# postgres=# drop function dup(f1 anyelement, OUT f2 anyelement, OUT f3 anyarray); postgres=# postgres=#