Summary
Add a make print-pgtle target that outputs the correct pg_tle registration SQL to stdout, using version-aware directory selection.
Motivation
When building combined pg_tle registration files (e.g., pgtle-all.sql that registers multiple extensions in dependency order), consumers currently need to know:
- The extension name (from
.control file)
- The correct
pg_tle/{version-range}/ directory for the installed pg_tle version
- The file path within that directory
A print-pgtle target would encapsulate this logic, making combined file generation simpler:
# Current approach (consumer must know internals):
ext=$$(basename ../deps/cat_tools/*.control .control); \
echo "\\ir ../deps/cat_tools/$$(pgxntool/pgtle.sh --get-dir $$PGTLE_VERSION)/$$ext.sql"
# With print-pgtle (consumer just calls make):
$(MAKE) -C ../deps/cat_tools print-pgtle
Proposed Behavior
# Outputs the pg_tle SQL content to stdout
make print-pgtle
# With explicit version
make print-pgtle PGTLE_VERSION=1.5.2
The target would:
- Detect pg_tle version (from
PGTLE_VERSION env/var, or via pgtle.sh --get-version)
- Select the correct version directory via
pgtle.sh --get-dir
- Output the registration SQL to stdout
This pairs well with pgxntool's existing pgtle and run-pgtle targets in base.mk.
Summary
Add a
make print-pgtletarget that outputs the correct pg_tle registration SQL to stdout, using version-aware directory selection.Motivation
When building combined pg_tle registration files (e.g.,
pgtle-all.sqlthat registers multiple extensions in dependency order), consumers currently need to know:.controlfile)pg_tle/{version-range}/directory for the installed pg_tle versionA
print-pgtletarget would encapsulate this logic, making combined file generation simpler:Proposed Behavior
The target would:
PGTLE_VERSIONenv/var, or viapgtle.sh --get-version)pgtle.sh --get-dirThis pairs well with pgxntool's existing
pgtleandrun-pgtletargets inbase.mk.