Expand description
SQL routine definitions and static signature lookup contracts.
Modules§
- anonymous_
block - Compile an anonymous procedural block against the caller’s current catalog.
- attributes
- The checks
PostgreSQLmakes of routine attributes, each at its own stage:compute_common_attributefor each clause in written order, the valuescompute_function_attributesandAlterFunctioninterpret, and the language, transforms, body and ROWS thatCreateFunctionexamines. - body_
parameters - The parameters a SQL routine’s body names, by name or by position, as
PostgreSQL’s parser resolves them in each statement of the body. - body_
validation - The body checks of
PostgreSQL’s SQL-language validator,fmgr_sql_validator, which also hold when a body runs: each statement is analyzed against the catalog before it runs, a reference to a parameter the routine lacks is an error, aCALLof a procedure with output arguments is rejected, and the final statement is checked against the declared result. - call
- Procedure argument validation, static overload selection, and declared result schemas.
- compilation
- Routine language validation and body lowering over declared types and fresh binding inputs.
- configuration
- SQL rules for configuration saved on a routine definition.
- declaration
- Routine type references, polymorphic signatures, and declaration validation.
- definition_
output - Source bodies, estimates and saved configuration in routine definitions.
- dependencies
- Bind stored routine relation, column, and routine identities against fresh catalog inputs.
- inlining
- Caller-plan expansion of selected SQL routines. Source text is analyzed for each planning attempt; declining expansion never changes the session body cache.
- invocation
- Routine invocation metadata, concrete signatures, and anonymous-record assignment rules.
- lifecycle
- Routine removal identities, dependency results, and declaration diagnostics.
- merge_
columns - Persistent MERGE write-target identities and compilation-copy normalization.
- privilege_
inquiry - Function privilege inquiry semantics with strict name resolution and nullable OID lookup.
- regclass
- Creation-time relation identities in SQL-standard bodies and argument defaults.
- registration
- Routine replacement compatibility, security attributes, and ALTER definition analysis.
- resolution
- Static routine signature matching, invocation binding, and declared return-type resolution.
- result_
check - The final statement of a SQL function body checked against the declared result, as
PostgreSQL’scheck_sql_fn_retvalchecks it at creation and before execution. - security
- Routine execution authorization, owner transitions, and grant-option reachability.
Structs§
- SQLUser
Function - A registered routine: the persistable definition and its body as the catalog keeps it.
- Static
Function Match
Enums§
- Compiled
Function Body - Executable form of a routine body.
- Routine
Body - A routine body as the catalog keeps it. A SQL-standard body is bound when the routine is defined, as
PostgreSQLstoresprosqlbodyas parse trees that name objects by OID. A body given as a string is compiled by each session that uses the routine, as the backend function cache compilesprosrc, so its names resolve when that session first needs them. A routine body as the catalog keeps it.
Traits§
- Routine
Resolution - Function-catalog operations required by static query binding. The interface deliberately excludes storage, transaction, locking, and execution services so the binder can run against a deterministic catalog fixture.
Functions§
- analyzable_
routine_ body - The body a static analysis sees, or
Nonewhen the body does not compile in this session. Such a routine cannot run in the session, and running it reports the compilation error, asPostgreSQLcompiles a routine only when it runs; internal failures still propagate. - builtin_
routine_ support_ oid - function_
binding_ matches - is_
routine_ namespace_ lookup_ error - routine_
kind - routine_
local_ name - routine_
returns_ anonymous_ record - routine_
signature_ types