Skip to content
ERPForAll DocsDevelopment

    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 with server_version_num < 180000 is refused with a typed error naming the found and required versions.
    • PostgreSQL 19 Compatibility: Servers reporting server_version_num >= 190000 are 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 OVERLAPS temporal 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, and pg_stat_statements, along with settings for wal_level, io_method, and max_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 where pg_trgm is 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 as sync or worker are valid across providers; io_uring is 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_statements must be explicitly configured to at least 1024 (to match the ORM connection statement cache limit). The default of 200 introduced 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 LISTEN connection 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 LISTEN requires 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 LISTEN connection (responsible for registry invalidation, policy generation bumps, and realtime bus notifications) must connect:
      1. Directly to the PostgreSQL primary instance; or
      2. 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.

    All GA claims below are sourced or labeled unverified (ADR 0028 §1, docs/design/pg-features.md §1.4).

    ProviderPG 18 StatusExtensions (pg_trgm, btree_gist, pg_stat_statements)Documentation / SourceNotes
    AWS RDS for PostgreSQLGA (since 2025-11-14 with 18.1; 18.6 current)All three supportedAWS RDS Release Calendar, ExtensionsLogical replication supported via rds.logical_replication; io_uring support unverified.
    Amazon Aurora PostgreSQLGA (since 2026-06-11, starting with 18.3+)AvailableAurora PG 18 Announcementio_method configuration reportedly not exposed (unverified).
    Google Cloud SQLGA and default for new instances (18.6 current)All three supportedCloud SQL PG Versions, ExtensionsRegular support listed from 2025-09-25. pgoutput supported.
    Google AlloyDBGA (since 2026-03-18)AvailableAlloyDB Version PoliciesDefaults new clusters to PG 17; select PostgreSQL 18 explicitly during cluster provisioning.
    Azure Flexible ServerGA (18.6 current)All three supportedAzure Supported Versions, ExtensionsAzure documentation notes that io_method = io_uring cannot be set.
    DigitalOcean Managed DatabasesGA (Standard edition)All three supportedDigitalOcean Supported ExtensionsStandard managed cluster provisioning.
    NeonGA (since 2026-05-01)All three supportedNeon Changelog 2026-05-01, ExtensionsServerless PostgreSQL; logical replication supported.
    Crunchy BridgeGA (lists 15–18)AvailableCrunchy Bridge Postgres VersionsGA release date unverified (not stated on versions documentation page).
    Heroku PostgresGA and default (since 2026-08-04)All three supportedHeroku Changelog #3751, Version SupportLogical replication available on Advanced tier and above.
    Supabase (Hosted)Unsupportedpg_stat_statements onlySupabase Upgrading GuideHosted platform offers only PG 15 and 17 (no PG 18 announcement). Self-hosted Supabase on PG 18 is supported.
    Self-Hosted (Linux / Docker)SupportedAll supportedOfficial PostgreSQL 18 DownloadsOfficial Debian/Ubuntu/RHEL packages or official Docker image postgres:18.