Governance Basics
8 examples to get you started with Postgres governance - 5 basic and 3 intermediate.
Search across all documentation pages
8 examples to get you started with Postgres governance - 5 basic and 3 intermediate.
ls docs/postgresql-style-guide.md # or repo equivalent
psql -c "SELECT extname FROM pg_extension ORDER BY 1;"One document covers all product databases on Postgres.
# PostgreSQL Style Guide (excerpt)
- Tables: plural snake_case (`orders`, `line_items`)
- PK: `bigint GENERATED ALWAYS AS IDENTITY` or `uuid` with explicit default
- Timestamps: `timestamptz` named `created_at`, `updated_at`
- FK: `{referenced_table_singular}_id`
- No reserved words unquotedRelated: Naming & Documentation Standards - comments and ERDs
CREATE ROLE app_read NOLOGIN;
CREATE ROLE app_write NOLOGIN;
CREATE ROLE migrator LOGIN PASSWORD 'vault-rotated';
GRANT app_read TO app_api;
GRANT app_write TO app_worker;
-- migrator owns DDL in CI onlyapp_user superuser across services.BYPASSRLS reserved for break-glass accounts with audit.| Extension | Status | Owner |
|---|---|---|
| pgcrypto | Approved | platform |
| pgvector | Approved | search team |
| postgis | Approved | logistics |
| plpython3u | Denied | - |
SELECT extname, extversion FROM pg_extension;Related: Extension & Plugin Governance - cadence
Service team authors SQL → DBA reviews tier → CI applies with migrator role# ADR-0142: JSONB config blob on tenants
Status: Accepted
Context: Rapid tenant flags before GA
Consequence: Validate in app; migrate to columns by Q4
Review date: 2026-12-01docs/adr/ linked from ER diagrams.-- Weekly job: objects created outside migrator role
SELECT obj.object_identity, ev.objid, ev.classid
FROM pg_event_trigger_ddl_commands() ev
JOIN pg_identify_object(ev.classid, ev.objid, ev.objsubid) obj
ON true;
-- Prefer ddl audit via pgaudit or event trigger in platform accountCREATE TABLE owner is not migrator.payments_db and billing_db both use same:
- naming guide
- timestamp conventions
- RLS policy naming (`{table}_tenant_isolation`)lock_timeout, etc.).| KPI | Target |
|---|---|
| Migrations without tier tag | 0 |
| Unauthorized extensions | 0 |
| ADR exceptions past review date | 0 open |
| Council attendance | > 80% teams represented |
Related: Governance Best Practices - full checklist
Stack versions: This page was written for PostgreSQL 18.4 (stable 18, maintenance 17), pgvector 0.8+, PgBouncer 1.x, Patroni 3.x, and PostGIS 3.5+.
Reviewed by Chris St. John·Last updated Jul 16, 2026