Skip to content

[Feature]: Dynamic loading of PostgreSQL extensions #7188

@gbartolini

Description

@gbartolini

Is there an existing issue already for this feature request/idea?

  • I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.

What problem is this feature going to solve? Why should it be added?

Currently, extensions must be part of the base image of the operand, requiring pre-determination of the entire content of the Postgres image and preventing dynamic loading of extensions.

The reason is detailed in this blog article that I wrote: https://www.gabrielebartolini.it/articles/2025/03/the-immutable-future-of-postgresql-extensions-in-kubernetes-with-cloudnativepg/

Describe the solution you'd like

Following the exploration work done in #6546 and the PostgreSQL 18 feature for extension_control_path we contributed to (see postgres/postgres@4f7f7b0), we should enable dynamic loading of extensions via the new ImageVolume feature introduced in Kubernetes 1.33. This guarantees immutability of container images.

Rollout is required by image volumes.

This feature will only be available with Postgres 18 and Kubernetes 1.33+. Also, extensions must be distributed as self-contained images - this is part of another initiative, outside CloudNativePG.

Image catalogs must be considered as well.

Describe alternatives you've considered

We have considered mutable solutions (use a mutable volume to install needed extensions), but we preferred to contribute to Postgres improvements and exploit innovation in Kubernetes with Image Volumes.

Additional context

See the blog article cited above.

Backport?

No

Are you willing to actively contribute to this feature?

Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Projects

Status

Done

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions