# PostgreSQL operations Purpose - Operate the canonical PostgreSQL control plane with deterministic behavior. Schema topology - Per-module schemas: authority, vuln, vex, scheduler, notify, policy, concelier, audit. - Tenant isolation enforced via tenant_id and RLS policies. Performance setup - Enable pg_stat_statements for query analysis. - Tune shared_buffers, effective_cache_size, work_mem, and WAL sizes per host. - Use PgBouncer in transaction pooling mode for high concurrency. Session defaults - SET app.tenant_id per connection. - SET timezone to UTC. - Enforce statement_timeout for long-running queries. Query analysis - Use pg_stat_statements to find high total and high mean latency queries. - Use EXPLAIN ANALYZE with BUFFERS to detect missing indexes. Backups and restore - Use scheduled logical or physical backups with tested restore paths. - Keep PITR capability where required by retention policies. - Validate backups with deterministic restore tests. Monitoring - Track connection count, replication lag, and slow query rates. - Alert on pool saturation and replication delays. Related references - data/postgresql-patterns.md - data/persistence.md - docs/operations/postgresql-guide.md