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-oss 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. postgis and timescaledb-oss are mounted from the configured CNPG image catalog (timescaledb-oss is also preloaded); any other name must be bundled with the Postgres image. All are activated with CREATE EXTENSION in the application database.

Type: string
Required: true
Pattern: ^[a-z_][a-z0-9_-]*$

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.

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