Contents
pg_get_function_identity_arguments()
A function for generating a function/procedure argument list
pg_get_function_identity_arguments()
is a system function for generating the argument list for a function or procedure as a text string. The generated string does not contain any default values, and is suitable for usage as a function signature for commands such as ALTER FUNCTION
.
pg_get_function_identity_arguments()
was added in PostgreSQL 8.4.
Usage
pg_get_function_identity_arguments (oid
) →text
pg_get_function_identity_arguments()
is similar to pg_get_function_arguments()
, except that it does not emit any default arguments.
Change history
- PostgreSQL 8.4
- added (commit 455dffbb)
Examples
Basic usage example for pg_get_function_identity_arguments()
:
postgres=# CREATE FUNCTION foo(id INT, message TEXT) RETURNS TEXT LANGUAGE SQL AS $$ SELECT message || ':' || id::TEXT $$; CREATE FUNCTION postgres=# SELECT pg_get_function_identity_arguments('foo(int, text)'::regprocedure); pg_get_function_identity_arguments ------------------------------------ id integer, message text (1 row)
Any default arguments are omitted:
postgres=# CREATE FUNCTION bar (message TEXT DEFAULT 'no message supplied') RETURNS TEXT LANGUAGE SQL AS $$ SELECT 'The message is: ' || message $$; CREATE FUNCTION postgres=# SELECT pg_get_function_identity_arguments('bar(text)'::regprocedure); pg_get_function_identity_arguments ------------------------------------ message text (1 row)
References
- PostgreSQL documentation: System Catalog Information Functions