]> begriffs open source - ai-pg/blob - full-docs/txt/catalog-pg-proc.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / catalog-pg-proc.txt
1
2 52.39. pg_proc #
3
4    The catalog pg_proc stores information about functions, procedures,
5    aggregate functions, and window functions (collectively also known as
6    routines). See CREATE FUNCTION, CREATE PROCEDURE, and Section 36.3 for
7    more information.
8
9    If prokind indicates that the entry is for an aggregate function, there
10    should be a matching row in pg_aggregate.
11
12    Table 52.39. pg_proc Columns
13
14    Column Type
15
16    Description
17
18    oid oid
19
20    Row identifier
21
22    proname name
23
24    Name of the function
25
26    pronamespace oid (references pg_namespace.oid)
27
28    The OID of the namespace that contains this function
29
30    proowner oid (references pg_authid.oid)
31
32    Owner of the function
33
34    prolang oid (references pg_language.oid)
35
36    Implementation language or call interface of this function
37
38    procost float4
39
40    Estimated execution cost (in units of cpu_operator_cost); if proretset,
41    this is cost per row returned
42
43    prorows float4
44
45    Estimated number of result rows (zero if not proretset)
46
47    provariadic oid (references pg_type.oid)
48
49    Data type of the variadic array parameter's elements, or zero if the
50    function does not have a variadic parameter
51
52    prosupport regproc (references pg_proc.oid)
53
54    Planner support function for this function (see Section 36.11), or zero
55    if none
56
57    prokind char
58
59    f for a normal function, p for a procedure, a for an aggregate
60    function, or w for a window function
61
62    prosecdef bool
63
64    Function is a security definer (i.e., a “setuid” function)
65
66    proleakproof bool
67
68    The function has no side effects. No information about the arguments is
69    conveyed except via the return value. Any function that might throw an
70    error depending on the values of its arguments is not leakproof.
71
72    proisstrict bool
73
74    Function returns null if any call argument is null. In that case the
75    function won't actually be called at all. Functions that are not
76    “strict” must be prepared to handle null inputs.
77
78    proretset bool
79
80    Function returns a set (i.e., multiple values of the specified data
81    type)
82
83    provolatile char
84
85    provolatile tells whether the function's result depends only on its
86    input arguments, or is affected by outside factors. It is i for
87    “immutable” functions, which always deliver the same result for the
88    same inputs. It is s for “stable” functions, whose results (for fixed
89    inputs) do not change within a scan. It is v for “volatile” functions,
90    whose results might change at any time. (Use v also for functions with
91    side-effects, so that calls to them cannot get optimized away.)
92
93    proparallel char
94
95    proparallel tells whether the function can be safely run in parallel
96    mode. It is s for functions which are safe to run in parallel mode
97    without restriction. It is r for functions which can be run in parallel
98    mode, but their execution is restricted to the parallel group leader;
99    parallel worker processes cannot invoke these functions. It is u for
100    functions which are unsafe in parallel mode; the presence of such a
101    function forces a serial execution plan.
102
103    pronargs int2
104
105    Number of input arguments
106
107    pronargdefaults int2
108
109    Number of arguments that have defaults
110
111    prorettype oid (references pg_type.oid)
112
113    Data type of the return value
114
115    proargtypes oidvector (references pg_type.oid)
116
117    An array of the data types of the function arguments. This includes
118    only input arguments (including INOUT and VARIADIC arguments), and thus
119    represents the call signature of the function.
120
121    proallargtypes oid[] (references pg_type.oid)
122
123    An array of the data types of the function arguments. This includes all
124    arguments (including OUT and INOUT arguments); however, if all the
125    arguments are IN arguments, this field will be null. Note that
126    subscripting is 1-based, whereas for historical reasons proargtypes is
127    subscripted from 0.
128
129    proargmodes char[]
130
131    An array of the modes of the function arguments, encoded as i for IN
132    arguments, o for OUT arguments, b for INOUT arguments, v for VARIADIC
133    arguments, t for TABLE arguments. If all the arguments are IN
134    arguments, this field will be null. Note that subscripts correspond to
135    positions of proallargtypes not proargtypes.
136
137    proargnames text[]
138
139    An array of the names of the function arguments. Arguments without a
140    name are set to empty strings in the array. If none of the arguments
141    have a name, this field will be null. Note that subscripts correspond
142    to positions of proallargtypes not proargtypes.
143
144    proargdefaults pg_node_tree
145
146    Expression trees (in nodeToString() representation) for default values.
147    This is a list with pronargdefaults elements, corresponding to the last
148    N input arguments (i.e., the last N proargtypes positions). If none of
149    the arguments have defaults, this field will be null.
150
151    protrftypes oid[] (references pg_type.oid)
152
153    An array of the argument/result data type(s) for which to apply
154    transforms (from the function's TRANSFORM clause). Null if none.
155
156    prosrc text
157
158    This tells the function handler how to invoke the function. It might be
159    the actual source code of the function for interpreted languages, a
160    link symbol, a file name, or just about anything else, depending on the
161    implementation language/call convention.
162
163    probin text
164
165    Additional information about how to invoke the function. Again, the
166    interpretation is language-specific.
167
168    prosqlbody pg_node_tree
169
170    Pre-parsed SQL function body. This is used for SQL-language functions
171    when the body is given in SQL-standard notation rather than as a string
172    literal. It's null in other cases.
173
174    proconfig text[]
175
176    Function's local settings for run-time configuration variables
177
178    proacl aclitem[]
179
180    Access privileges; see Section 5.8 for details
181
182    For compiled functions, both built-in and dynamically loaded, prosrc
183    contains the function's C-language name (link symbol). For SQL-language
184    functions, prosrc contains the function's source text if that is
185    specified as a string literal; but if the function body is specified in
186    SQL-standard style, prosrc is unused (typically it's an empty string)
187    and prosqlbody contains the pre-parsed definition. For all other
188    currently-known language types, prosrc contains the function's source
189    text. probin is null except for dynamically-loaded C functions, for
190    which it gives the name of the shared library file containing the
191    function.