Nais Postgres reference ΒΆ
This document describes all possible configuration values in the Postgres spec, commonly known as the postgres.yaml file. Each Postgres is one CNPG cluster managed by pgrator. spec.activeBranch is deprecated: branches were retired, and only main (or omitting it) is accepted.
activeBranch ΒΆ
ActiveBranch is deprecated: branches were retired. Only main (or empty)
is accepted; the field is kept so existing manifests stay valid.
Type: string
Required: false
autoExplain ΒΆ
AutoExplain logs JSON execution plans for statements taking at least one second. Includes actual row counts and buffer usage, with per-node timing and parameter values disabled. Adds instrumentation overhead. Enabling or disabling it on an existing cluster requires a rolling restart.
Type: boolean
Required: false
Example
spec:
autoExplain: trueextensions ΒΆ
Extensions to activate in the application database. Removing an entry drops the extension (without CASCADE); postgis and timescaledb stay mounted and preloaded until the drop succeeds. The drop fails, and is retried, while other objects depend on the extension.
Type: array
Required: false
Example
spec:
extensions:
- name: postgisextensions[].name ΒΆ
Name of the extension, as used in CREATE EXTENSION. postgis and timescaledb are mounted from the configured CNPG image catalog (timescaledb is also preloaded); the rest are bundled with the Postgres image. pg_stat_statements and pgaudit are managed by the platform and cannot be requested.
Type: enum
Required: true
Allowed values: amcheck, bloom, btree_gin, btree_gist, citext, cube, earthdistance, fuzzystrmatch, hstore, intarray, isn, lo, ltree, pageinspect, pg_buffercache, pg_freespacemap, pg_logicalinspect, pg_prewarm, pg_trgm, pg_visibility, pg_walinspect, pgcrypto, pgrowlocks, pgstattuple, postgis, seg, sslinfo, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, vector
Example
spec:
extensions:
- name: postgishighAvailability ΒΆ
HighAvailability adds a third instance and enables synchronous replication.
A cluster always runs a primary and a standby, so failover is available either way. What this adds is the guarantee that an acknowledged commit survives losing the primary, at the cost of write latency.
Type: boolean
Required: false
Example
spec:
highAvailability: truemajorVersion ΒΆ
MajorVersion of Postgres to use.
Type: enum
Required: true
Allowed values: 18
Example
spec:
majorVersion: "18"pitr ΒΆ
PITR configures the continuous point-in-time recovery window.
Type: object
Required: false
Example
spec:
pitr:
windowDays: 2pitr.windowDays ΒΆ
WindowDays is how many days back in time the database can be recovered to. Older recovery data (base backups and WAL) is removed by barman, which checks periodically. The base backup preceding the window is kept, so data up to a day older may remain. Allowed range is 2 to 30 days. Defaults to 2 when omitted.
Type: integer
Required: false
Value range: 2-30
Example
spec:
pitr:
windowDays: 2resources ΒΆ
Resources configures compute and disk for the Postgres cluster.
Type: object
Required: false
Example
spec:
resources:
cpu: 100m
diskSize: 10Gi
memory: 512Miresources.cpu ΒΆ
Cpu is the CPU resources for the Postgres cluster.
Type: integer or string
Required: false
Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
Example
spec:
resources:
cpu: 100mresources.diskSize ΒΆ
DiskSize is the disk size for the Postgres cluster. Minimum is 5Gi.
Type: integer or string
Required: false
Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
Example
spec:
resources:
diskSize: 10Giresources.memory ΒΆ
Memory is the memory resources for the Postgres cluster.
Type: integer or string
Required: false
Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
Example
spec:
resources:
memory: 512Mi