Skip to main content

Module routines

Module routines 

Source
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 PostgreSQL makes of routine attributes, each at its own stage: compute_common_attribute for each clause in written order, the values compute_function_attributes and AlterFunction interpret, and the language, transforms, body and ROWS that CreateFunction examines.
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, a CALL of 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’s check_sql_fn_retval checks it at creation and before execution.
security
Routine execution authorization, owner transitions, and grant-option reachability.

Structs§

SQLUserFunction
A registered routine: the persistable definition and its body as the catalog keeps it.
StaticFunctionMatch

Enums§

CompiledFunctionBody
Executable form of a routine body.
RoutineBody
A routine body as the catalog keeps it. A SQL-standard body is bound when the routine is defined, as PostgreSQL stores prosqlbody as 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 compiles prosrc, so its names resolve when that session first needs them. A routine body as the catalog keeps it.

Traits§

RoutineResolution
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 None when the body does not compile in this session. Such a routine cannot run in the session, and running it reports the compilation error, as PostgreSQL compiles 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