Expand description
The database contract of a query read from a function.
A query whose sql_source_kind is function is read as SELECT … FROM fn($1, …): the
executor binds the query’s own arguments (auto-params left out) in declaration order, then
one parameter per inject param, and reads the query’s jsonb_column from each row. The
function must therefore exist with exactly that many input parameters, return a set, return
that column as json/jsonb, and not be VOLATILE: a read may be cached, retried or served
from a replica, and none of those is safe for a function that writes.
check_function_root answers that from catalog rows, so it is tested without a database;
validate_function_roots reads the rows for every function root of a schema.
Functions§
- check_
function_ root - What is wrong with the function
queryreads, given every overload of its name (candidates); empty when the read will bind and run. - function_
roots - The queries of
schemathat read from a function. - validate_
function_ roots - Check every function root of
schemaagainst the database, asquery \name` (sql_source: fn): problem` lines.