1/*-------------------------------------------------------------------------
4 * definition of the "procedure" system catalog (pg_proc)
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * src/include/catalog/pg_proc.h
12 * The Catalog.pm module reads this file and derives schema
15 *-------------------------------------------------------------------------
22#include "catalog/pg_proc_d.h" /* IWYU pragma: export */
26 * pg_proc definition. cpp turns this into
27 * typedef struct FormData_pg_proc
37 /* OID of namespace containing this proc */
43 /* OID of pg_language entry */
46 /* estimated execution cost */
49 /* estimated # of rows out (if proretset) */
52 /* element type of variadic array, or 0 if not variadic */
55 /* planner support function for this function, or 0 if none */
58 /* see PROKIND_ categories below */
61 /* security definer */
64 /* is it a leakproof function? */
67 /* strict with respect to NULLs? */
73 /* see PROVOLATILE_ categories below */
76 /* see PROPARALLEL_ categories below */
79 /* number of arguments */
80 /* Note: need not be given in pg_proc.dat; genbki.pl will compute it */
83 /* number of arguments with defaults */
86 /* OID of result type */
90 * variable-length fields start here, but we allow direct access to
94 /* parameter types (excludes OUT params) */
99 /* all param types (NULL if IN only) */
102 /* parameter modes (NULL if IN only) */
105 /* parameter names (NULL if no names) */
108 /* list of expression trees for argument defaults (NULL if none) */
111 /* types for which to apply transforms */
114 /* procedure source text */
117 /* secondary procedure info (can be NULL) */
120 /* pre-parsed SQL function body */
123 /* procedure-local GUC settings */
126 /* access permissions */
132 * Form_pg_proc corresponds to a pointer to a tuple with
133 * the format of pg_proc relation.
141 DECLARE_UNIQUE_INDEX(pg_proc_proname_args_nsp_index, 2691, ProcedureNameArgsNspIndexId, pg_proc, btree(
proname name_ops, proargtypes oidvector_ops, pronamespace oid_ops));
146#ifdef EXPOSE_TO_CLIENT_CODE
149 * Symbolic values for prokind column
151#define PROKIND_FUNCTION 'f'
152#define PROKIND_AGGREGATE 'a'
153#define PROKIND_WINDOW 'w'
154#define PROKIND_PROCEDURE 'p'
157 * Symbolic values for provolatile column: these indicate whether the result
158 * of a function is dependent *only* on the values of its explicit arguments,
159 * or can change due to outside factors (such as parameter variables or
160 * table contents). NOTE: functions having side-effects, such as setval(),
161 * must be labeled volatile to ensure they will not get optimized away,
162 * even if the actual return value is not changeable.
164#define PROVOLATILE_IMMUTABLE 'i' /* never changes for given input */
165#define PROVOLATILE_STABLE 's' /* does not change within a scan */
166#define PROVOLATILE_VOLATILE 'v' /* can change even within a scan */
169 * Symbolic values for proparallel column: these indicate whether a function
170 * can be safely be run in a parallel backend, during parallelism but
171 * necessarily in the leader, or only in non-parallel mode.
173#define PROPARALLEL_SAFE 's' /* can run in worker or leader */
174#define PROPARALLEL_RESTRICTED 'r' /* can run in parallel leader only */
175#define PROPARALLEL_UNSAFE 'u' /* banned while in parallel mode */
178 * Symbolic values for proargmodes column. Note that these must agree with
179 * the FunctionParameterMode enum in parsenodes.h; we declare them here to
180 * be accessible from either header.
182#define PROARGMODE_IN 'i'
183#define PROARGMODE_OUT 'o'
184#define PROARGMODE_INOUT 'b'
185#define PROARGMODE_VARIADIC 'v'
186#define PROARGMODE_TABLE 't'
188#endif /* EXPOSE_TO_CLIENT_CODE */
197 Oid languageObjectId,
198 Oid languageValidator,
203 bool security_definer,
209 Datum allParameterTypes,
210 Datum parameterModes,
211 Datum parameterNames,
212 List *parameterDefaults,
224#endif /* PG_PROC_H */
#define BKI_LOOKUP_OPT(catalog)
#define BKI_FORCE_NOT_NULL
#define BKI_ROWTYPE_OID(oid, oidmacro)
ObjectAddress ProcedureCreate(const char *procedureName, Oid procNamespace, bool replace, bool returnsSet, Oid returnType, Oid proowner, Oid languageObjectId, Oid languageValidator, const char *prosrc, const char *probin, Node *prosqlbody, char prokind, bool security_definer, bool isLeakProof, bool isStrict, char volatility, char parallel, oidvector *parameterTypes, Datum allParameterTypes, Datum parameterModes, Datum parameterNames, List *parameterDefaults, Datum trftypes, List *trfoids, Datum proconfig, Oid prosupport, float4 procost, float4 prorows)
FormData_pg_proc * Form_pg_proc
DECLARE_UNIQUE_INDEX(pg_proc_proname_args_nsp_index, 2691, ProcedureNameArgsNspIndexId, pg_proc, btree(proname name_ops, proargtypes oidvector_ops, pronamespace oid_ops))
DECLARE_UNIQUE_INDEX_PKEY(pg_proc_oid_index, 2690, ProcedureOidIndexId, pg_proc, btree(oid oid_ops))
Oid prorettype BKI_LOOKUP(pg_type)
List * oid_array_to_list(Datum datum)
CATALOG(pg_proc, 1255, ProcedureRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81
ProcedureRelation_Rowtype_Id BKI_SCHEMA_MACRO
DECLARE_TOAST(pg_proc, 2836, 2837)
bool function_parse_error_transpose(const char *prosrc)
MAKE_SYSCACHE(PROCOID, pg_proc_oid_index, 128)
Oid pronamespace BKI_DEFAULT(pg_catalog) BKI_LOOKUP(pg_namespace)