symfonic.memory.backends.postgres_working_guard_schema¶
postgres_working_guard_schema ¶
Explicit PostgreSQL guard for opt-in Working endpoint identities.
This DDL is not part of PostgresGraphBackend.ensure_schema. The host installs it before admitting a PostgreSQL Working writer. Database triggers are necessary because an older v0 process still writes memory_edges directly.
Working advisory contention refuses immediately with SQLSTATE 23514 rather than waiting. Legacy callers must roll back their transaction before retrying; this does not establish liveness for other row locks or unmanaged savepoints.
Trust boundary: installer/table owner, named Working host, and legacy graph writers are three distinct roles. The Working host is trusted with graph DML and guard-row SELECT/INSERT/UPDATE, but never table ownership, DDL, TRIGGER, or TRUNCATE. Legacy writers have graph DML only and no guard-table privilege. Neither role may own the schema or inherit the installer's owner role. The installer/owner and superuser retain DDL/TRUNCATE power and are trusted; this cannot defend against their tampering. Admission attests grants and ownership; privileged DDL after admission requires separate operational control.