Skip to content

Add make print-pgtle target for combined pg_tle install files - #94

Draft
jnasbyupgrade wants to merge 1 commit into
Postgres-Extensions:masterfrom
jnasbyupgrade:issue-21-print-pgtle
Draft

Add make print-pgtle target for combined pg_tle install files#94
jnasbyupgrade wants to merge 1 commit into
Postgres-Extensions:masterfrom
jnasbyupgrade:issue-21-print-pgtle

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

Summary

Adds a make print-pgtle target that prints the generated pg_tle registration SQL for each extension to stdout instead of running it, so a consumer can build a combined multi-extension install file:

$(MAKE) --no-print-directory -C ../deps/cat_tools print-pgtle >> pgtle-all.sql
  • Depends on pgtle (regenerates SQL first, like run-pgtle).
  • New PGXNTOOL_PGTLE_TARGET_VERSION variable (an actual pg_tle version like 1.5.2, not a range) selects the directory; falls back to the installed pg_tle version if unset.
  • Deliberately not named bare PGTLE_VERSION (would reopen the pgtle.sh: Makefile's PGTLE_VERSION variable silently collides with a consumer's same-named env var #78 collision) or reusing PGXNTOOL_PGTLE_VERSION (that holds a range, a different concept).
  • Documents a real footgun found while writing tests: GNU Make auto-prints Entering directory/Leaving directory to stdout on recursive invocation, corrupting a redirected combined file unless --no-print-directory is passed. Called out prominently in README.asc and base.mk.

Companion PR

pgxntool-test: Postgres-Extensions/pgxntool-test#(link added once opened)

Test plan

  • Full pgxntool-test suite (254/254, 0 failed, 0 skipped) passes with this branch paired against the companion test PR.

Fixes #21.

`print-pgtle` prints the generated pg_tle registration SQL for each
extension to stdout instead of running it, letting a consumer build a
combined multi-extension install file without needing to know the
extension name or which `pg_tle/` version-range directory applies:

    $(MAKE) --no-print-directory -C ../deps/cat_tools print-pgtle >> pgtle-all.sql

Depends on `pgtle` (regenerates SQL first, like `run-pgtle`). Selects
the directory via the new `PGXNTOOL_PGTLE_TARGET_VERSION` variable (an
actual pg_tle version like `1.5.2`) if set, otherwise via the installed
pg_tle version (same detection `run-pgtle` uses). Deliberately not
named bare `PGTLE_VERSION` or reusing `PGXNTOOL_PGTLE_VERSION`: the
former would reopen the issue Postgres-Extensions#78 collision with a CI job's env var of
that name, and the latter holds a range, not an exact version -- two
different concepts that would silently diverge if collapsed into one
variable.

`--no-print-directory` is required whenever this is invoked
recursively for stdout capture: GNU Make auto-prints "Entering
directory"/"Leaving directory" to stdout for recursive invocations,
which would otherwise corrupt the redirected file. Documented
prominently since it's easy to miss.

Documents the new target and variable in README.asc (+ regenerated
README.html).

Related changes in pgxntool-test:
- test/sequential/04-pgtle.bats: PGXNTOOL_PGTLE_TARGET_VERSION directory
  selection, non-collision with bare PGTLE_VERSION, and a regression
  test for the --no-print-directory requirement
- test/standard/pgtle-install.bats: DB-fallback and not-installed error
  path coverage

Fixes Postgres-Extensions#21.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ca7d0d22-ca6c-4208-9c48-b1236d991550

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Add make print-pgtle target for version-aware pg_tle SQL output

1 participant