TablespaceVolumes feature gate. Each tablespace is backed by its own PersistentVolumeClaim, and PGO handles creating the directory structure and registering the tablespace inside PostgreSQL automatically.
Enable the feature gate
To use tablespace volumes, enable theTablespaceVolumes feature gate on the operator deployment. Add the flag to the operator’s startup arguments:
Define tablespace volumes
Once the feature gate is enabled, add atablespaceVolumes list to the instance set definition. Each entry requires a unique name and a dataVolumeClaimSpec describing the PersistentVolumeClaim.
TablespaceVolume fields
How PGO sets up tablespace directories
WhenTablespaceVolumes is enabled and configured, PGO:
- Creates a PersistentVolumeClaim for each
tablespaceVolumesentry. - Mounts each PVC into the instance pod.
- Creates the required PostgreSQL tablespace directory structure inside the mounted volume.
- Creates a symlink so PostgreSQL can locate the tablespace at the expected path.
- Registers the tablespace in PostgreSQL using
CREATE TABLESPACE.
CREATE TABLESPACE manually; PGO handles the full lifecycle.
Use a tablespace in PostgreSQL
Once the tablespace is created by PGO, you can use it by name in SQL:Considerations
- Name constraints: Tablespace names must match
^[a-z][a-z0-9]*$. They must be unique within an instance set because they become both the directory path and the PostgreSQL tablespace identifier. - Volume expansion: Tablespace PVCs can be resized using the same approach as the main data volume. See Resize cluster resources.
- Replicas: Each instance in the set gets its own PVC per tablespace. PGO ensures tablespace directories exist on all instances so that replicas can follow the primary correctly.
- Backups: pgBackRest does not automatically back up tablespace volumes that are separate PVCs. Ensure your backup strategy accounts for tablespace data.
Next steps
Resize cluster resources
Expand tablespace PVCs and adjust compute resources.
Feature gates reference
View all available feature gates and their maturity stages.