Skip to content

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

@jnasbyupgrade

Description

@jnasbyupgrade

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:

  1. The extension name (from .control file)
  2. The correct pg_tle/{version-range}/ directory for the installed pg_tle version
  3. 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:

  1. Detect pg_tle version (from PGTLE_VERSION env/var, or via pgtle.sh --get-version)
  2. Select the correct version directory via pgtle.sh --get-dir
  3. Output the registration SQL to stdout

This pairs well with pgxntool's existing pgtle and run-pgtle targets in base.mk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions