pg_proc
The pg_proc system catalog table stores information about functions, both built-in functions and those defined by CREATE FUNCTION.
The table contains data for aggregate and window functions.
If proisagg is true, there should be a matching row in pg_aggregate.
For compiled functions, both built-in and dynamically loaded, prosrc contains the function’s C-language name (link symbol).
For all other currently known language types, prosrc contains the function’s source text.
probin is unused except for dynamically loaded C functions, for which it gives the name of the shared library file containing the function.
| Column | Type | References | Description |
|---|---|---|---|
oid |
oid |
— |
Row identifier (hidden attribute; must be explicitly selected) |
proname |
name |
— |
Name of the function |
pronamespace |
oid |
pg_namespace.oid |
The OID of the namespace that contains this function |
proowner |
oid |
pg_authid.oid |
Owner of the function |
prolang |
oid |
pg_language.oid |
Implementation language or call interface of this function |
procost |
float4 |
— |
Estimated execution cost (in |
prorows |
float4 |
— |
Estimated number of result rows ( |
provariadic |
oid |
pg_type.oid |
Data type of the variadic array parameter’s elements, or |
protransform |
regproc |
pg_proc.oid |
Calls to this function can be simplified by this other function |
proisagg |
boolean |
— |
Function is an aggregate function |
proiswindow |
boolean |
— |
Function is a window function |
prosecdef |
boolean |
— |
Function is a security definer (for example, a |
proleakproof |
boolean |
— |
The function has no side effects. No information about the arguments is conveyed except via the return value. Any function that might throw an error depending on the values of its arguments is not leak-proof |
proisstrict |
boolean |
— |
Function returns |
proretset |
boolean |
— |
Function returns a set (multiple values of the specified data type) |
provolatile |
char |
— |
Tells whether the function’s result depends only on its input arguments or is affected by outside factors:
|
pronargs |
int2 |
— |
Number of arguments |
pronargdefaults |
int2 |
— |
Number of arguments that have default values |
prorettype |
oid |
pg_type.oid |
Data type of the return value |
proargtypes |
oidvector |
pg_type.oid |
An array with the data types of the function arguments.
This includes only input arguments (including |
proallargtypes |
oid[] |
pg_type.oid |
An array with the data types of the function arguments.
This includes all arguments (including |
proargmodes |
char[] |
— |
An array with the modes of the function arguments:
If all the arguments are |
proargnames |
text[] |
— |
An array with the names of the function arguments.
Arguments without a name are set to empty strings in the array.
If none of the arguments have a name, this field will be |
proargdefaults |
pg_node_tree |
— |
Expression trees (in |
prosrc |
text |
— |
This tells the function handler how to invoke the function. It might be the actual source code of the function for interpreted languages, a link symbol, a file name, or just about anything else, depending on the implementation language/call convention |
probin |
text |
— |
Additional information about how to invoke the function. Again, the interpretation is language-specific |
proconfig |
text[] |
— |
Function’s local settings for run-time configuration variables |
proacl |
aclitem[] |
— |
Access privileges for the function as given by |
prodataaccess |
char |
— |
Provides a hint regarding the type SQL statements that are included in the function:
|
proexeclocation |
char |
— |
Where the function runs when it is invoked:
|