pg_proc

The pg_proc catalog provides information about functions, procedures, aggregates, and window functions.

Column name Data type Description
oid oid A row identifier.
proname name The name of the function.
pronamespace oid (references pg_namespace.oid) The OID of the namespace that contains the function.
proowner oid (references pg_authid.oid) The owner of the function.
prolang oid (references pg_language.oid) The implementation language or call interface of the function.
procost float4 The estimated execution cost, measured in units of the cpu_operator_cost. If the function returns a set (proretset), it specifies the cost for each row produced.
prorows float4 The estimated count of result rows.
0 – The function does not return a set (proretset).
provariadic oid (references pg_type.oid) The data type of the variadic array parameter’s elements.
0 – The function has no variadic parameter.
prosupport regproc (references pg_proc.oid) A planner support function for the function.
0 – The function has no planner support function.
prokind char The type of a database object.
The possible values are:
  • f – A function.
  • a – An aggregate.
  • w – A window function.
prosecdef bool Specifies whether the function is a security definer (the “setuid” function) (TRUE) or not (FALSE).
proleakproof bool Specifies whether the function has no side effects and reveals nothing about arguments except via the return value (TRUE) or not (FALSE).
proisstrict bool Specifies whether the function is strict, meaning the function automatically returns NULL if any of its input arguments is NULL. The function is not called if a NULL argument is present.
proretset bool Specifies whether the function returns multiple values.
provolatile char A volatility category.
The possible values are:
  • i – Immutable.
  • s – Stable.
  • v – Volatile.
proparallel char A parallel safety.
The possible values are:
  • s – Safe.
  • r – Restricted to a leader.
  • u – Unsafe.
pronargs int2 The number of input arguments.
pronargdefaults int2 The number of arguments that have default values.
prorettype oid (references pg_type.oid) The data type of a return value.
proargtypes oidvector (references pg_type.oid) The array of input argument data types.
proallargtypes oid[] (references pg_type.oid) The array of all argument data types (IN, OUT, INOUT, VARIADIC, TABLE).
NULL – All arguments are IN.
proargmodes char[] The array of argument modes:
  • i – IN.
  • o – OUT.
  • b – INOUT.
  • v – VARIADIC.
  • t – TABLE.
proargnames text[] The array of argument names.
Other possible outputs:
  • Empty string – Unnamed arguments.
  • NULL – Arguments have no names assigned.
proargdefaults pg_node_tree Expression trees, represented in the nodeToString() format, for any argument default values. It contains one entry for each of the pronargdefaults arguments.
NULL – No arguments have defaults.
protrftypes oid[] (references pg_type.oid) The argument or result data types for which transforms defined in the TRANSFORM clause must be applied.
NULL – No transforms are specified.
prosrc text The information on how to invoke the function. It can include the source code, link symbols, file names, etc.
probin text Additional language-specific invocation information.
prosqlbody pg_node_tree The pre-parsed SQL function body for SQL-language functions.
NULL – Non-SQL-language functions.
proconfig text[] The function’s local run-time configuration variable settings.
proacl aclitem[] Access privileges.