'Anyelement' parameter : Function Parameter « Store Procedure Function « PostgreSQL






'Anyelement' parameter


postgres=#
postgres=# CREATE FUNCTION is_greater(anyelement, anyelement) RETURNS boolean AS $$
postgres$#    SELECT $1 > $2;
postgres$# $$ LANGUAGE SQL;
CREATE FUNCTION
postgres=#
postgres=# SELECT is_greater(1, 2);
   REATE
 is_greater
------------
 f
(1 row)

postgres=#
postgres=# drop function is_greater(anyelement, anyelement);
DROP FUNCTION
postgres=#
postgres=#
           
       








Related examples in the same category

1.Here the $1 references the value of the first function argument whenever the function is invoked
2.Pass constant to function
3.OUT parameter
4.Output parameters are most useful when returning multiple values
5.Real number parameter
6.Two out parameters
7.Pass in a whole row
8.Use defined data type as the function parameter