Skip to content

Conversation

@NiccoloFei
Copy link
Collaborator

@NiccoloFei NiccoloFei commented Jan 9, 2025

Add support to allow setting up PostgreSQL extensions via container images, taking advance of the ImageVolume VolumeSource of Kubernetes and the new proposed GUC of PostgreSQL extension_control_path.

Introduce a new API field Extensions in the cluster.Spec.PostgresConfiguration stanza, which takes an array of PostgreSQL extensions which should be added to the Cluster.

@NiccoloFei NiccoloFei requested review from a team and jsilvela as code owners January 9, 2025 12:01
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.22 release-1.24 release-1.25 labels Jan 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2025

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@NiccoloFei NiccoloFei marked this pull request as draft January 9, 2025 12:10
@mnencia mnencia added do not backport This PR must not be backported - it will be in the next minor release and removed backport-requested ◀️ This pull request should be backported to all supported releases release-1.22 release-1.24 release-1.25 labels Jan 9, 2025
@gbartolini gbartolini force-pushed the dev/5645 branch 5 times, most recently from 12f8aca to 3300af6 Compare March 1, 2025 07:19
@gbartolini
Copy link
Contributor

The extension_control_path patch has been merged in PostgreSQL. The postgres-trunk-containers project now ships that GUC and we can use it to test in the future. See: postgres/postgres@4f7f7b0

@NiccoloFei
Copy link
Collaborator Author

/test limit=local feature_type=smoke

@github-actions
Copy link
Contributor

@NiccoloFei, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/14946124968

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label May 10, 2025
Comment on lines 706 to 712
// Set all ExtensionControlPaths
setExtensionControlPath(info, configuration)

// Set all DynamicLibraryPaths
setDynamicLibraryPath(info, configuration)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it guaranteed that we'll always have both extensionControlPath and dynamicLibraryPath if we are inside the block?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hossain-rayhan I think so, given that we want to adhere to the PGXS standard declared in https://www.postgresql.org/docs/devel/extend-pgxs.html, for which every extension (even the most basic ones) will have extension control and SQL files in /share and the shared library in /lib. So we'll have to set both those GUCs to allow PG to find the extension's files. Although I'm wondering how the build infra would behave in case of pure-SQL extensions. I'll try to test/investigate this specific use case, but I think the worst that could happen is that we'd end up setting a useless path inside dynamic_library_path.
Were you thinking of a specific scenario, or was it just a generic question?

@NiccoloFei NiccoloFei force-pushed the dev/5645 branch 2 times, most recently from bb910ea to 612fec1 Compare June 27, 2025 15:21
@NiccoloFei NiccoloFei force-pushed the dev/5645 branch 4 times, most recently from bb4713d to 336c822 Compare July 4, 2025 13:19
@NiccoloFei NiccoloFei marked this pull request as ready for review July 7, 2025 08:57
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement 🪄 New feature or request labels Jul 7, 2025
NiccoloFei and others added 11 commits July 7, 2025 14:08
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Also, automatically manage extension_control_path and dynamic_library_path.

Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
@NiccoloFei
Copy link
Collaborator Author

Closing this PR as its purpose was to serve as exploration work for the new feature.
Superseded by #7991

@NiccoloFei NiccoloFei closed this Jul 7, 2025
@NiccoloFei NiccoloFei deleted the dev/5645 branch July 7, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not backport This PR must not be backported - it will be in the next minor release enhancement 🪄 New feature or request ok to merge 👌 This PR can be merged size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants