You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#576–#581 fold committed session_replication_role mutations through direct SET, PostgreSQL's set_config(...), and writable pg_settings.setting. The shared lexical authority deliberately makes dollar-quoted bodies opaque. PostgreSQL DO, however, executes its code body immediately as a transient anonymous function. A committed migration can therefore hide an execution-context mutation inside a DO body:
DO $$
BEGIN
PERFORM set_config('session_replication_role', 'replica', false);
END
$$;
After lexical normalization the dollar body is intentionally masked, so the current execution-context fold sees only a DO statement and cannot prove that ordinary append-only/retention triggers remained enabled. With is_local=false, the set_config value is session-scoped; even transaction-local mutations can permit protected DML to commit while ordinary triggers are suppressed.
dollar-quoted text used as data (SELECT $$DO ...$$) and marker text inside comments/literals must remain inert;
CREATE FUNCTION/PROCEDURE ... AS $$...$$ must not be rejected merely because its body is opaque: definition is not immediate execution;
do not parse PL/pgSQL locally or introduce a second raw-SQL lexer. Reuse the shared lexical normalization: after the body is masked, a committed statement whose first structural token is exactly DO is unprovable execution context and therefore fails closed.
This is a bounded safety repair, not the architectural endpoint. The long-term execution-context aggregate should model immediately executed procedural SQL, nested dynamic SQL, configuration mutation, protected-DML ordering, privileges, and transaction outcome explicitly.
Keep open until post-#538 non-force-restack exact-head hosted Rust/Live PostgreSQL, current-topology rustdoc/coverage/security, and qualifying independent approval exist. Draft-skipped execution is not GREEN.
Finding
#576–#581 fold committed
session_replication_rolemutations through directSET, PostgreSQL'sset_config(...), and writablepg_settings.setting. The shared lexical authority deliberately makes dollar-quoted bodies opaque. PostgreSQLDO, however, executes its code body immediately as a transient anonymous function. A committed migration can therefore hide an execution-context mutation inside aDObody:After lexical normalization the dollar body is intentionally masked, so the current execution-context fold sees only a
DOstatement and cannot prove that ordinary append-only/retention triggers remained enabled. Withis_local=false, theset_configvalue is session-scoped; even transaction-local mutations can permit protected DML to commit while ordinary triggers are suppressed.PostgreSQL 18 authority:
DOexecutes an anonymous code block once and treats it as a transient function body: https://www.postgresql.org/docs/18/sql-do.htmlset_configis the function equivalent ofSET, andpg_settings.settingis another equivalent surface: https://www.postgresql.org/docs/18/config-setting.htmlsession_replication_role=replicaprevents ordinary/default triggers and rules from firing: https://www.postgresql.org/docs/18/runtime-config-client.html#GUC-SESSION-REPLICATION-ROLEContract
At exported
validate_migration_catalog():DOblock must fail closed withMissingAppRuntimeRoleuntil TEPP owns executable procedural-body semantics;DO LANGUAGE plpgsql $$...$$andDO $$...$$ LANGUAGE plpgsqlare the same execution-risk boundary;DOblock inside an explicit transaction that rolls back remains non-durable through fix(persistence): exclude rolled-back membership mutations from RLS safety evidence #560 committed-state projection and must not poison final validation;SELECT $$DO ...$$) and marker text inside comments/literals must remain inert;CREATE FUNCTION/PROCEDURE ... AS $$...$$must not be rejected merely because its body is opaque: definition is not immediate execution;DOis unprovable execution context and therefore fails closed.This is a bounded safety repair, not the architectural endpoint. The long-term execution-context aggregate should model immediately executed procedural SQL, nested dynamic SQL, configuration mutation, protected-DML ordering, privileges, and transaction outcome explicitly.
Keep open until post-#538 non-force-restack exact-head hosted Rust/Live PostgreSQL, current-topology rustdoc/coverage/security, and qualifying independent approval exist. Draft-skipped execution is not GREEN.