Nais Postgres reference ΒΆ

Experimental feature

This feature is an alpha feature, and is subject to API change, instability or removal. See the main Postgres page for more information.

This document describes all possible configuration values in the Postgres spec, commonly known as the postgres.yaml file. A Postgres is a logical database: pgrator creates its default main branch as a separate CNPG cluster. spec.activeBranch requests a local branch name; status.activeBranch is the observed selection. A requested branch must have an initialized, Ready, non-terminating CNPG cluster before pgrator updates observed status. This check is not an atomic cutover guarantee; verify workload connections when switching branches.

activeBranch ΒΆ

ActiveBranch selects the local branch name within this Postgres for normal workloads. When omitted, pgrator retains the current active branch.

Type: string
Required: false

Example

yaml

extensions ΒΆ

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

yaml

extensions[].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

yaml

highAvailability ΒΆ

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

yaml

majorVersion ΒΆ

MajorVersion of Postgres to use.

Type: enum
Required: true
Allowed values: 18

Example

yaml

resources ΒΆ

Resources configures compute and disk for the Postgres cluster.

Type: object
Required: false

Example

yaml

resources.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

yaml

resources.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

yaml

resources.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

yaml