Skip to main content

Module body_validation

Module body_validation 

Source
Expand description

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.

Structs§

SQLBodyValidationContext
The catalog CREATE FUNCTION validates a SQL body against.

Functions§

reject_output_argument_call
Resolve the procedure a CALL names and reject one with output arguments, which PostgreSQL does not support in SQL functions.
reject_undefined_parameters
Reject a reference to a parameter the routine does not declare, as PostgreSQL’s parser reports it.
routine_parameter_values
Typed placeholders for the parameters the body names, against which analysis types references to them.
sql_body_is_analyzable
Whether a SQL body can be analyzed without the argument types of a call: PostgreSQL only parses the body of a routine with polymorphic arguments until a call supplies them.
validate_sql_function_body
Validate a compiled SQL body as CREATE FUNCTION does: analyze each statement in order against the catalog, without running any of them, and when check_result holds, check the final statement against the declared result.