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

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)

Categories

Functions and procedures, System catalogue, System function

See also

pg_get_functiondef(), pg_get_function_arguments(), pg_get_function_result()