Skip to content

Fix PGXS DOCS collision: use extension-specific filenames#34

Open
iemejia wants to merge 1 commit into
dimitri:masterfrom
iemejia:fix/pgxs-docs-collision
Open

Fix PGXS DOCS collision: use extension-specific filenames#34
iemejia wants to merge 1 commit into
dimitri:masterfrom
iemejia:fix/pgxs-docs-collision

Conversation

@iemejia

@iemejia iemejia commented Jun 25, 2026

Copy link
Copy Markdown

Fixes #33

Problem

PGXS installs files listed in DOCS to a flat shared directory:

/usr/share/doc/postgresql-doc-XX/extension/

With DOCS = $(wildcard *.md), both README.md and TESTS.md are
installed to this shared directory. The generic README.md filename
collides with any other extension that also declares DOCS = README.md
(e.g., postgres_protobuf, temporal_tables). When multiple extensions
are installed on the same system or composed via Docker COPY --from
layers, the last one silently overwrites the others.

Solution

Change DOCS to use a *.prefix.md wildcard pattern. Extension-specific
filenames are generated at build time by copying the source markdown files:

  • README.md -> README.prefix.md
  • TESTS.md -> TESTS.prefix.md

This way:

  • Source files remain untouched (GitHub repo page still works)
  • Installed doc files get unique names that cannot collide
  • Generated files are added to .gitignore and cleaned by make clean

Changes

  • Makefile: DOCS = $(wildcard *.prefix.md) + copy rules + clean target
  • .gitignore: ignore the generated files

PGXS installs DOCS to a flat shared directory:
/usr/share/doc/postgresql-doc-XX/extension/

Multiple extensions using DOCS = README.md collide at the same path,
causing silent overwrites in multi-extension installations and
Docker-based layering.

Generate README.prefix.md and TESTS.prefix.md from source files at
build time so installed doc files have unique names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PGXS DOCS = $(wildcard *.md) causes file collision with other extensions

1 participant