43.24. pg_proc

The catalog pg_proc stores information about functions (or procedures). The description of CREATE FUNCTION and Section 33.3 contain more information about the meaning of some columns.

The table contains data for aggregate functions as well as plain functions. If proisagg is true, there should be a matching row in pg_aggregate.

Table 43-24. pg_proc Columns

NameTypeReferencesDescription
pronamename Name of the function
pronamespaceoidpg_namespace.oid The OID of the namespace that contains this function
proownerint4pg_shadow.usesysidOwner of the function
prolangoidpg_langauge.oidImplementation language or call interface of this function
proisaggbool Function is an aggregate function
prosecdefbool Function is a security definer (i.e., a "setuid" function)
proisstrictbool  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.
proretsetbool Function returns a set (i.e., multiple values of the specified data type)
provolatilechar  provolatile tells whether the function's result depends only on its input arguments, or is affected by outside factors. It is i for "immutable" functions, which always deliver the same result for the same inputs. It is s for "stable" functions, whose results (for fixed inputs) do not change within a scan. It is v for "volatile" functions, whose results may change at any time. (Use v also for functions with side-effects, so that calls to them cannot get optimized away.)
pronargsint2 Number of arguments
prorettypeoidpg_type.oidData type of the return value
proargtypesoidvectorpg_type.oidAn array with the data types of the function arguments
prosrctext  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.
probinbytea Additional information about how to invoke the function. Again, the interpretation is language-specific.
proaclaclitem[] Access privileges

prosrc contains the function's C-language name (link symbol) for compiled functions, both built-in and dynamically loaded. For all other 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.

c