Mega Code Archive

 
Categories / PostgreSQL / Postgre SQL
 

Two anyelement parameters

postgres=# postgres=# CREATE FUNCTION make_array(anyelement, anyelement) RETURNS anyarray AS $$ postgres$#    SELECT ARRAY[$1, $2]; postgres$# $$ LANGUAGE SQL; CREATE FUNCTION postgres=# postgres=# SELECT make_array(1, 2) AS intarray, make_array('a'::text, 'b') AS textarray;         REATE  intarray | textarray ----------+-----------  {1,2}    | {a,b} (1 row) postgres=# postgres=# postgres=# drop function make_array(anyelement, anyelement); DROP FUNCTION postgres=#