Skip to content

Add historical install scripts from PGXN distributions#12

Merged
jnasbyupgrade merged 4 commits intoPostgres-Extensions:masterfrom
jnasbyupgrade:historical-sql-files
Apr 17, 2026
Merged

Add historical install scripts from PGXN distributions#12
jnasbyupgrade merged 4 commits intoPostgres-Extensions:masterfrom
jnasbyupgrade:historical-sql-files

Conversation

@jnasbyupgrade
Copy link
Copy Markdown
Contributor

@jnasbyupgrade jnasbyupgrade commented Apr 15, 2026

Adds historical versions to the repo to allow for testing updates.

  • For 0.2.0 and 0.2.1, add .sql.in source files, built by make for the running Postgres version using the existing sed conditional system
  • Adds pre-built .sql files for 0.1.0 - 0.1.5
  • Updates Makefile to pick up versioned install script .sql.in files and include all historical scripts in $DATA
  • Updates sql/.gitignore to ignore generated files

🤖 Generated with Claude Code

jnasbyupgrade added a commit to jnasbyupgrade/cat_tools that referenced this pull request Apr 16, 2026
8176304 Stamp 2.0.2
3e142ab Fix parse_control_file: remove comments before stripping quotes (#27)
cacc301 Stamp 2.0.1
bf1db6b Fix bash 3.2 / Linux compatibility issues (#26)
62d0fcb Fix broken ifeq for --load-language=plpgsql on PG < 13 (#24)
121f0b3 Stamp 2.0.0
ad3ca7e Remove .source support; add test/install, test/build, and verify-results (#18)
c010cf8 Fix bash 3.2 compatibility (#23)
abeb9d3 Remove .source file support from pg_regress integration (#22)
08c1879 Stamp 1.1.2
6e0dad2 Fix double --dbname bug that defeated unique test database names
639756c Stamp 1.1.1
6ba3176 Fix pg_tle exception handler and empty upgrade files (Postgres-Extensions#15)
3b8cb2a Stamp 1.1.0
550a901 Remove commit.md (maintained in pgxntool-test)
d73ca93 Add unique test database names to prevent conflicts (Postgres-Extensions#13)
9b344be Add update-setup-files.sh for 3-way merging after pgxntool-sync (Postgres-Extensions#12)
ab7f6e2 Stamp 1.0.0
3a571ba Add pg_tle support and modernize test infrastructure (Postgres-Extensions#11)
b96ea6d Add support for Claude code; build and doc improvements (Postgres-Extensions#9)
e9c24de Fix pg_regress on versions > 12 (#5)

git-subtree-dir: pgxntool
git-subtree-split: 81763048198c5927e89053135a496969bceb3bcf
jnasbyupgrade and others added 3 commits April 16, 2026 17:52
Each file is the canonical install script as published to PGXN:
- 0.1.0–0.1.4: extracted directly from PGXN zip (pre-built)
- 0.1.5–0.2.1: built from PGXN source for PG >= 9.5
  (REQUIRES 9.5 features enabled, PRIOR TO 9.5 alternatives commented out)

Also update .gitignore to allow tracking version-specific SQL files.

These are needed as starting points for upgrade path testing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
For versions 0.1.5, 0.2.0, and 0.2.1, replace the pre-built SQL files
with versioned .sql.in source files extracted from the original PGXN
distributions. The build system will now generate version-appropriate
SQL for the running Postgres version using the existing sed rules.

Findings from PGXN zip inspection:
- 0.1.0, 0.1.3, 0.1.4: only pre-built sql/cat_tools.sql (no .in source);
  kept as-is in sql/ with explicit DATA += entries
- 0.1.5: sql/cat_tools.in.sql exists but has no SED markers (pre-dates
  the conditional system); used as-is, sed processing is a no-op
- 0.2.0: sql/cat_tools.in.sql with SED: REQUIRES 9.3/9.5 markers
- 0.2.1: sql/cat_tools.sql.in with SED: REQUIRES/PRIOR TO 9.3/9.5 markers

Makefile changes:
- versioned_in glob widened from *--*--*.sql.in to *--*.sql.in so that
  single-version install scripts are processed alongside upgrade scripts
- Added DATA += for pre-built install scripts (0.1.0, 0.1.3, 0.1.4)
- Added DATA += $(versioned_out) for generated install scripts

sql/.gitignore: ignore generated cat_tools--0.1.5/0.2.0/0.2.1.sql files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0.1.5's PGXN source predates the SED conditional system and has no
REQUIRES/PRIOR TO markers, so building from .sql.in would produce
identical output regardless of PG version. Treat it like 0.1.0-0.1.4:
commit the pre-built SQL directly.

Also add a comment to sql/.gitignore explaining which versions are
generated vs committed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Makefile: filter EXTENSION_VERSION_FILES out of versioned_out to prevent
cat_tools--0.2.1.sql appearing twice in DATA (once from EXTENSION_VERSION_FILES
in base.mk, once from versioned_out since cat_tools--0.2.1.sql.in now exists).

trigger__parse: replace broken current_setting('server_version')::real version
check (fails on PG17 due to full version string like "17.9 (Ubuntu ...)") with
the proper EXECUTE (?:PROCEDURE|FUNCTION) regex approach. Also handle empty
function arguments with ARRAY[]::text[] cast.

test/deps.sql: grant CREATE on public schema to test role for PG15+
compatibility (PG15 removed implicit CREATE from PUBLIC).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jnasbyupgrade jnasbyupgrade merged commit a6832e2 into Postgres-Extensions:master Apr 17, 2026
13 checks passed
@jnasbyupgrade jnasbyupgrade deleted the historical-sql-files branch April 17, 2026 18:45
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.

1 participant