PostgreSQL 18 Providers and Setup Guide
ERPForAll requires PostgreSQL 18 as its foundation (ADR 0028 (docs/adr/0028-postgresql-feature-baseline.md, not part of the published documentation)).
This document provides requirements, connection pooler architecture, and provider verification details.
1. Version Requirement: PostgreSQL 18 Minimum
Section titled “1. Version Requirement: PostgreSQL 18 Minimum”- Minimum Version: PostgreSQL 18.0 (
server_version_num >= 180000). - Connection Gate (in review): enforced on every physical connection via the pool’s
connection hook (ADR 0028 (
docs/adr/0028-postgresql-feature-baseline.md, not part of the published documentation) §1). Any connection to a server withserver_version_num < 180000is refused with a typed error naming the found and required versions. - PostgreSQL 19 Compatibility: Servers reporting
server_version_num >= 190000are accepted and logged once per pool as “untested” until a compatibility check passes following 19’s GA. - Core PG 18 Primitives: The ORM relies on native PG 18 capabilities including
RETURNING OLD/NEW(for atomic upsert, tracking, and the transactional outbox without pre-reads),uuidv7(),WITHOUT OVERLAPStemporal constraints, btree skip scan, and asynchronous I/O.
2. Extensions and Server Capabilities Policy
Section titled “2. Extensions and Server Capabilities Policy”Per ADR 0028 §2, optional extensions and server features are probed, recorded, and reported at startup, NOT required for server startup:
- No Startup Exits: The server never exits on startup merely because an extension is absent.
- Probed Extensions: At pool initialization, the ORM records the presence of
pg_trgm,btree_gist,unaccent, andpg_stat_statements, along with settings forwal_level,io_method, andmax_locks_per_transaction. - Feature-Specific Enforcement:
pg_trgm: Installed when a database is created, as Odoo does (the create path is in review). If an addon declares a trigram index (index = "trigram") on a database wherepg_trgmis missing, the operation returns an error naming the field and the missing extension.btree_gist: Installed automatically by schema sync when a model declares an exclusion or temporal constraint requiring equality GiST indexing.pg_stat_statements: Recommended for production observability and query cost monitoring; optional in operation.io_method: Recorded in telemetry and benchmarks. Values such assyncorworkerare valid across providers;io_uringis never mandatory.
3. Connection Pooling and PgBouncer Configuration
Section titled “3. Connection Pooling and PgBouncer Configuration”3.1 PgBouncer Version and Prepared Statements
Section titled “3.1 PgBouncer Version and Prepared Statements”When placing PgBouncer in front of PostgreSQL:
- PgBouncer Version: ≥ 1.21 (required for prepared statement support).
- Prepared Statement Limit:
max_prepared_statementsmust be explicitly configured to at least1024(to match the ORM connection statement cache limit). The default of200introduced in PgBouncer 1.24 is too small for active ERP workloads. - Transaction Pooling: Transaction-level pooling (
pool_mode = transaction) is fully supported for standard ORM operations, batch updates, and transaction-scoped advisory locks.
3.2 Bypassing Transaction-Mode PgBouncer for LISTEN
Section titled “3.2 Bypassing Transaction-Mode PgBouncer for LISTEN”[!IMPORTANT] The
LISTENconnection of the cross-process signal must bypass transaction-mode PgBouncer (ADR 0028 §3.1 (docs/adr/0028-postgresql-feature-baseline.md, not part of the published documentation), pg-features.md:213 (docs/design/pg-features.md, not part of the published documentation), m3-signal.md:356 (docs/design/m3-signal.md, not part of the published documentation)).
- Reason: PostgreSQL
LISTENrequires a dedicated, persistent session. In transaction-mode pooling, backend connections are released after each transaction commit, terminating or misrouting asynchronous notifications. - Architecture: The long-running
LISTENconnection (responsible for registry invalidation, policy generation bumps, and realtime bus notifications) must connect:- Directly to the PostgreSQL primary instance; or
- Through a dedicated session-mode pool (
pool_mode = session).
- All other traffic (regular request transactions, CRUD, background job execution) continues through the standard transaction-mode pool.
4. Managed PostgreSQL Providers Matrix
Section titled “4. Managed PostgreSQL Providers Matrix”All GA claims below are sourced or labeled unverified (ADR 0028 §1, docs/design/pg-features.md §1.4).
| Provider | PG 18 Status | Extensions (pg_trgm, btree_gist, pg_stat_statements) | Documentation / Source | Notes |
|---|---|---|---|---|
| AWS RDS for PostgreSQL | GA (since 2025-11-14 with 18.1; 18.6 current) | All three supported | AWS RDS Release Calendar, Extensions | Logical replication supported via rds.logical_replication; io_uring support unverified. |
| Amazon Aurora PostgreSQL | GA (since 2026-06-11, starting with 18.3+) | Available | Aurora PG 18 Announcement | io_method configuration reportedly not exposed (unverified). |
| Google Cloud SQL | GA and default for new instances (18.6 current) | All three supported | Cloud SQL PG Versions, Extensions | Regular support listed from 2025-09-25. pgoutput supported. |
| Google AlloyDB | GA (since 2026-03-18) | Available | AlloyDB Version Policies | Defaults new clusters to PG 17; select PostgreSQL 18 explicitly during cluster provisioning. |
| Azure Flexible Server | GA (18.6 current) | All three supported | Azure Supported Versions, Extensions | Azure documentation notes that io_method = io_uring cannot be set. |
| DigitalOcean Managed Databases | GA (Standard edition) | All three supported | DigitalOcean Supported Extensions | Standard managed cluster provisioning. |
| Neon | GA (since 2026-05-01) | All three supported | Neon Changelog 2026-05-01, Extensions | Serverless PostgreSQL; logical replication supported. |
| Crunchy Bridge | GA (lists 15–18) | Available | Crunchy Bridge Postgres Versions | GA release date unverified (not stated on versions documentation page). |
| Heroku Postgres | GA and default (since 2026-08-04) | All three supported | Heroku Changelog #3751, Version Support | Logical replication available on Advanced tier and above. |
| Supabase (Hosted) | Unsupported | pg_stat_statements only | Supabase Upgrading Guide | Hosted platform offers only PG 15 and 17 (no PG 18 announcement). Self-hosted Supabase on PG 18 is supported. |
| Self-Hosted (Linux / Docker) | Supported | All supported | Official PostgreSQL 18 Downloads | Official Debian/Ubuntu/RHEL packages or official Docker image postgres:18. |