52.39. pg_proc
pg_proc
The catalog pg_proc stores information about functions, procedures, aggregate functions, and window functions (collectively also known as routines). See CREATE FUNCTION, CREATE PROCEDURE, and User-Defined Functions for more information.
If prokind indicates that the entry is for an aggregate function, there should be a matching row in pg_aggregate.
Column Type Description |
|---|
oid Row identifier |
proname Name of the function |
pronamespace The OID of the namespace that contains this function |
proowner Owner of the function |
prolang Implementation language or call interface of this function |
procost Estimated execution cost (in units of [cpu_operator_cost (floating point)
|
prorows Estimated number of result rows (zero if not proretset) |
provariadic Data type of the variadic array parameter's elements, or zero if the function does not have a variadic parameter |
prosupport Planner support function for this function (see Function Optimization Information), or zero if none |
prokind
|
prosecdef Function is a security definer (i.e., a "setuid" function) |
proleakproof 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 leakproof. |
proisstrict Function returns null if any call argument is null. In that case the function won't actually be called at all. Functions that are not "strict" must be prepared to handle null inputs. |
proretset Function returns a set (i.e., multiple values of the specified data type) |
provolatile provolatile tells whether the function's result depends only on its input arguments, or is affected by outside factors. It is |
proparallel proparallel tells whether the function can be safely run in parallel mode. It is |
pronargs Number of input arguments |
pronargdefaults Number of arguments that have defaults |
prorettype Data type of the return value |
proargtypes An array of the data types of the function arguments. This includes only input arguments (including |
proallargtypes An array of the data types of the function arguments. This includes all arguments (including |
proargmodes An array of the modes of the function arguments, encoded as |
proargnames An array of 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 null. Note that subscripts correspond to positions of proallargtypes not proargtypes. |
proargdefaults Expression trees (in |
protrftypes An array of the argument/result data type(s) for which to apply transforms (from the function's |
prosrc 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 Additional information about how to invoke the function. Again, the interpretation is language-specific. |
prosqlbody Pre-parsed SQL function body. This is used for SQL-language functions when the body is given in SQL-standard notation rather than as a string literal. It's null in other cases. |
proconfig Function's local settings for run-time configuration variables |
proacl Access privileges; see Privileges for details |
: pg_proc Columns
For compiled functions, both built-in and dynamically loaded, prosrc contains the function's C-language name (link symbol). For SQL-language functions, prosrc contains the function's source text if that is specified as a string literal; but if the function body is specified in SQL-standard style, prosrc is unused (typically it's an empty string) and prosqlbody contains the pre-parsed definition. For all other currently-known language types, prosrc contains the function's source text. probin is null except for dynamically-loaded C functions, for which it gives the name of the shared library file containing the function.