Mega Code Archive

 
Categories / PostgreSQL / Postgre SQL
 

Default value assignment

postgres=# postgres=# -- Default value assignment postgres=# postgres=# CREATE FUNCTION identifier (int4) RETURNS int4 AS ' postgres'#   DECLARE postgres'#     an_integer int4 := 10; postgres'#   BEGIN postgres'#     return an_integer; postgres'#   END; postgres'# ' LANGUAGE 'plpgsql'; CREATE FUNCTION postgres=# postgres=# postgres=# select identifier(10);  identifier ------------          10 (1 row) postgres=# postgres=# postgres=# drop function identifier (int4); DROP FUNCTION postgres=# postgres=#