Skip to content

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

Open
jnasbyupgrade wants to merge 1 commit intomasterfrom
rebuild-0.2.0-0.2.1-upgrade
Open

Replace cat_tools--0.2.0--0.2.1.sql with rebuilt .sql.in#15
jnasbyupgrade wants to merge 1 commit intomasterfrom
rebuild-0.2.0-0.2.1-upgrade

Conversation

@jnasbyupgrade
Copy link
Copy Markdown
Contributor

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

Test plan

  • Upgrade path PG 9.3: SED markers processed correctly (9.5 features absent)
  • Upgrade path PG 9.5+: regnamespace[] return types and extnamespace::regnamespace extschema active
  • CI passes across full PG matrix

🤖 Generated with Claude Code

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>
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