Skip to content

Replace cat_tools--0.2.0--0.2.1.sql with rebuilt .sql.in#15

Merged
jnasbyupgrade merged 3 commits intomasterfrom
rebuild-0.2.0-0.2.1-upgrade
Apr 20, 2026
Merged

Replace cat_tools--0.2.0--0.2.1.sql with rebuilt .sql.in#15
jnasbyupgrade merged 3 commits intomasterfrom
rebuild-0.2.0-0.2.1-upgrade

Conversation

@jnasbyupgrade
Copy link
Copy Markdown
Contributor

@jnasbyupgrade jnasbyupgrade commented Apr 17, 2026

Problem

The committed cat_tools--0.2.0--0.2.1.sql was generated for PG 9.3–9.4 only. The -- SED: REQUIRES 9.5! markers were manually pre-processed (commented out) but the -- SED: PRIOR TO 9.5! counterpart lines were never added. On PG ≥ 9.5 this silently installs:

  • Wrong return types for extension__schemas / extension__schemas_unique (name[] instead of regnamespace[])
  • Wrong extschema column in pg_extension_v (nspname instead of extnamespace::regnamespace)

Fix

Replace with a proper .sql.in, rebuilt from the diff of cat_tools.sql.in between 0.2.0 and 0.2.1. Contains only the actual delta (not a full install script copy-paste):

  • pg_extension_v view — correct REQUIRES/PRIOR TO 9.5 SED marker pair
  • pg_extension__get, extension__schemas/unique (name[] + text overloads) — correct SED markers for return type
  • trigger__get_oid__loose — smarter tgname quote-stripping
  • trigger__get_oid — proper errcode on exception
  • trigger__parse(oid) — DROP + recreate with new OUT params (trigger_table, trigger_function; function_arguments text → text[])
  • trigger__parse(regclass, text) — new overload
  • trigger__args_as_text — new backwards-compat helper
  • object__reg_type_catalog — fix hint URL

🤖 Generated with Claude Code

jnasbyupgrade and others added 2 commits April 20, 2026 16:10
The committed .sql was generated for PG 9.3-9.4 only: REQUIRES 9.5!
markers were manually pre-processed (commented out) while PRIOR TO 9.5!
counterparts were missing entirely, causing silent installation of the
wrong return types and extschema column on PG >= 9.5.

Rebuild from the diff of cat_tools.sql.in between 0.2.0 and 0.2.1:
- pg_extension_v, pg_extension__get, extension__schemas/unique (name[]
  and text overloads) with correct REQUIRES/PRIOR TO 9.5 SED markers
- trigger__get_oid__loose: smarter tgname quote-stripping
- trigger__get_oid: proper errcode on exception
- trigger__parse(oid): DROP + recreate with new OUT params
  (trigger_table, trigger_function; function_arguments text -> text[])
- trigger__parse(regclass, text): new overload
- trigger__args_as_text: new backwards-compat helper
- object__reg_type_catalog: fix hint URL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
base.mk already adds sql/*--*--*.sql via wildcard; adding them again
via versioned_out caused a duplicate-file error in make install.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jnasbyupgrade jnasbyupgrade force-pushed the rebuild-0.2.0-0.2.1-upgrade branch from ff61d3c to 197befa Compare April 20, 2026 21:11
The old name was confusing — upgrade scripts are "versioned" by definition.
upgrade_scripts_out is clearer about what the variable represents.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jnasbyupgrade jnasbyupgrade merged commit 4b4a4f7 into master Apr 20, 2026
26 checks passed
@jnasbyupgrade jnasbyupgrade deleted the rebuild-0.2.0-0.2.1-upgrade branch April 20, 2026 21:36
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