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§
- SQLBody
Validation Context - The catalog
CREATE FUNCTIONvalidates a SQL body against.
Functions§
- reject_
output_ argument_ call - Resolve the procedure a
CALLnames and reject one with output arguments, whichPostgreSQLdoes 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:
PostgreSQLonly 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 FUNCTIONdoes: analyze each statement in order against the catalog, without running any of them, and whencheck_resultholds, check the final statement against the declared result.