symfonic.memory.backends.postgres_memory_generation_schema¶
postgres_memory_generation_schema ¶
The memory erase generation table's DDL, attestation and grants (CORE-199).
postgres_memory_generation reads and advances the rows; this module owns
what every read first attests: the table beside memory_nodes, its
canonical constraint, and exactly two forward triggers, both ENABLE ALWAYS
so session_replication_role=replica cannot skip them. Row security, a
rewrite rule or any further trigger on the table -- a BEFORE trigger sorting
after the guard could rewrite the row it admitted -- refuses as unguarded,
as does an inheritance child or parent (a child's rows are read through the
table but written past its triggers), or a table or trigger function not
owned by memory_nodes' owner (a migration run as another role, or a
superuser, installs objects no reader may trust). An UNLOGGED table refuses
too: crash recovery empties it, which would silently reopen every erased
scope. The columns, the primary key and every constraint expression must be
exactly the DDL's: the descendant range read compares keys byte-wise only
under the C collation. Constraint expressions are compared as PostgreSQL
16 deparses them; 16 is the attested server version, and on another a reader
may refuse as UNGUARDED.
The row trigger's arguments are the install witness, and the forward function
refuses every write to a sealed table (postgres_memory_generation_witness).
bound_witness
async
¶
(witness, server) of relation, once rows and the name are proved its own.
Source code in src/symfonic/memory/backends/postgres_memory_generation_witness.py
grant_runtime
async
¶
Owner side, in the caller's transaction; role is a validated identifier.
Source code in src/symfonic/memory/backends/postgres_memory_generation_schema.py
runtime_drift
async
¶
How role departs from read-and-advance on table, or None.