Skip to content

[Feature]: Only add image extension paths to Postgres GUCs when the directory exists #11650

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?

Image extensions currently contribute their directories to extension_control_path and dynamic_library_path unconditionally. If an image doesn't ship a given directory, the GUC still references it.

Example

postgresql:
  extensions:
    - name: pgvector
    - name: keycloak-oauth-validator
      ld_library_path:
        - system
      image:
        reference: ghcr.io/cloudnative-pg/postgres-keycloak-oauth-validator-testing:18-dev-trixie

The keycloak-oauth-validator image contains only lib/, system/ and licenses/. It has no share/. Even so:

postgres=# show extension_control_path;
 $system:/extensions/pgvector/share:/extensions/keycloak-oauth-validator/share

The second entry points to a non-existent directory.

Harmless today, but it is noise. It makes the effective configuration misleading when debugging, and it relies on Postgres silently ignoring missing path entries.

Describe the solution you'd like

When building path-like GUCs for image extensions, include a directory only if it exists in the mounted image volume.

We want to broaden image extensions to cover Postgres modules and other loadable components (auth validators, hooks, shared_preload_libraries entries). Many of these ship only lib/ and no share/, or the reverse. The mismatch will become the norm.

The same applies to dynamic_library_path and any path-like setting we add later.

Describe alternatives you've considered

N/A

Additional context

Acceptance criteria

  • With the example above, extension_control_path is $system:/extensions/pgvector/share.
  • dynamic_library_path follows the same behaviour.
  • No change for images that ship all the expected directories.
  • Documentation for image extensions states that missing directories are skipped.

Backport?

Yes

Are you willing to actively contribute to this feature?

Yes

Code of Conduct

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

Activity

  1. added this to the 1.31.0 milestone on Oct 13, 2026
  2. self-assigned this
    on Oct 13, 2026
  3. added
    enhancement 🪄
    on Oct 13, 2026
  4. added a commit that references this issue on Oct 14, 2026
    fe36bb1
  5. added a commit that references this issue on Oct 14, 2026
    6112a10
  6. added 2 commits that reference this issue on Oct 16, 2026
    c89cad0
    e8420dd
  7. added a commit that references this issue on Oct 16, 2026
    4c71005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement 🪄

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions