Skip to main content

Module statement

Module statement 

Source
Expand description

What a guest’s statement is, judged by its leading keywords: whatever runs a guest’s SQL decides the same way how it may run.

Functions§

changes_session
Statements that change session state rather than the transaction’s: SET other than SET LOCAL, SET TRANSACTION and SET CONSTRAINTS, and RESET.
controls_transaction
Transaction control, which inside a host-managed transaction would end or split it behind the host’s back.
requires_autocommit
Statements Postgres refuses inside a transaction block, judged by their leading keywords after any comments: CREATE/DROP INDEX CONCURRENTLY, REINDEX … CONCURRENTLY, REINDEX DATABASE/SYSTEM, VACUUM, CREATE/DROP DATABASE, CREATE/DROP TABLESPACE, ALTER SYSTEM, CLUSTER, DISCARD ALL.
rows_as_json
A caller’s SELECT wrapped to answer each row as JSON, limit rows at most. The SQL is wrapped, never concatenated onto another statement, and the newline after it keeps a query that ends in a -- comment from swallowing the limit.