Release cat_tools 0.2.2: fix PG11+ and PG12+ compatibility#7
Open
jnasbyupgrade wants to merge 21 commits intoPostgres-Extensions:masterfrom
Open
Release cat_tools 0.2.2: fix PG11+ and PG12+ compatibility#7jnasbyupgrade wants to merge 21 commits intoPostgres-Extensions:masterfrom
jnasbyupgrade wants to merge 21 commits intoPostgres-Extensions:masterfrom
Conversation
- Add __cat_tools.omit_column() helper to list catalog columns dynamically - Add ALTER DEFAULT PRIVILEGES IN SCHEMA cat_tools GRANT USAGE ON TYPES - Fix _cat_tools.pg_class_v: use omit_column to exclude duplicate oid (PG12+) - Fix _cat_tools.pg_attribute_v: omit attmissingval (anyarray, PG11+), include it cast to text::text[] so the column is preserved across PG versions - Fix cat_tools.pg_extension_v: use omit_column to exclude duplicate oid (PG12+) - Add control.mk to drive version file generation - Add sql/cat_tools--0.2.1--0.2.2.sql upgrade script Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use /* */ block comments (was --) - pg_attribute_v always includes attmissingval column as text[]: NULL::text[] on PG10 (column absent), a.attmissingval::text::text[] on PG11+. Uses hardcoded OID 1249 (pg_catalog.pg_attribute). - Add committed sql/cat_tools--0.2.1.sql for upgrade test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pgxntool/run-test-build.sh uses rsync to sync test/build/*.sql into test/build/sql/ for pg_regress. The pgxn/pgxn-tools container doesn't include rsync, so install it explicitly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- trigger__parse: handle EXECUTE FUNCTION (PG11+) and pg_temp schema alias mismatch - extension.sql test: avoid duplicate oid column (e.oid, e.*) on PG12+ - attribute.sql test: skip anyarray column (attmissingval) in results_eq comparison - object_type.sql test: grant CREATE on public schema for PG15+ compatibility - general.out: update expected output (test count was stale) - zzz_build.out: update expected output for new exec() calls - Add CLAUDE.md with SQL block comment style standard - Update .gitignore to track .claude/ but ignore *.local.json and worktrees/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Version-specific upgrade scripts are now committed directly as .sql files rather than generated from .sql.in sources. Remove the versioned_in/versioned_out machinery and switch DATA to pick up all historical install scripts via wildcard, filtering out files already provided by pgxntool/base.mk (EXTENSION_VERSION_FILES and sql/*--*--*.sql upgrade scripts). Note: pgxs DATA is not cleaned by `make clean` (only DATA_built is), so static committed SQL files are safe to include in DATA. Also add explanatory comment to sql/.gitignore. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace DROP VIEW ... CASCADE with CREATE OR REPLACE VIEW throughout the 0.2.1→0.2.2 upgrade script. On PG < 12 the column lists for pg_class_v and pg_extension_v are unchanged, so CREATE OR REPLACE VIEW works with no disruption to dependents. For pg_attribute_v, attmissingval is moved to the end of the column list (matching the new install script) so it can be added as a trailing column without invalidating any existing dependent views. Also removes the now-unnecessary recreation of pg_extension__get and the __cat_tools.create_function helper. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…icts Kept pgext/master's Makefile approach (versioned_in/versioned_out) since sql/cat_tools--0.2.0.sql.in and sql/cat_tools--0.2.1.sql.in exist. Merged both sets of .gitignore additions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pgxntool 2.0 added -include control.mk to base.mk. Having it again in the Makefile caused control.mk to be processed twice, doubling up EXTENSION_VERSION_FILES (duplicate sql/cat_tools--0.2.2.sql in DATA) and triggering "overriding recipe" warnings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
::regnamespace was hardcoded but that type only exists on PG 9.5+. The upgrade script is pre-built SQL (no SED processing), so use the same runtime EXISTS check pattern as the attmissingval fix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The upgrade script is now SED-processed like the install scripts. Replaces the runtime EXISTS/regnamespace check with proper -- SED: REQUIRES 9.5! / -- SED: PRIOR TO 9.5! markers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add LT11 and LT12 SED variables to Makefile. Replace the CASE-in-format EXISTS check for attmissingval with -- SED: REQUIRES 11! / PRIOR TO 11! markers in both the install and upgrade scripts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Restore -- SED: PRIOR TO 9.5! on nspname line; it had been left in already-processed form (-- Not used prior to 9.5:). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cat_tools 0.2.1incompatibility with PostgreSQL 11+ and 12+0.2.1 → 0.2.2upgrade script for existing installations0.2.1 → 0.2.2 → 0.3.0upgrade chainRoot Causes Fixed
PG11+:
_cat_tools.pg_attribute_vusedSELECT a.*frompg_attribute. PG11 addedattmissingvalwith pseudo-typeanyarray, which cannot be a view column. Fix: useomit_column()to enumerate columns explicitly, and includeattmissingvalcast totext::text[].PG12+:
_cat_tools.pg_class_vandcat_tools.pg_extension_vusedSELECT c.oid AS reloid, c.*/SELECT e.oid, e.*. PG12 made system catalogoidcolumns visible as regular columns, causing duplicate column names. Fix: useomit_column()to excludeoidfrom the wildcard expansion.Changes
sql/cat_tools.sql.in: Added__cat_tools.omit_column()helper; replaced three static views with dynamicexec(format(...))calls; addedALTER DEFAULT PRIVILEGES IN SCHEMA cat_tools GRANT USAGE ON TYPES TO cat_tools__usage; dropsomit_columnat end of installsql/cat_tools--0.2.1--0.2.2.sql: New upgrade script — temporarily recreatesexec,create_function, andomit_column; applies all view fixes; drops temporariescat_tools.control:default_version = '0.2.2'control.mk:EXTENSION_cat_tools_VERSION := 0.2.2META.json/META.in.json: Version bumped to 0.2.2Verified
CREATE EXTENSION cat_tools VERSION '0.2.1'fails as expected;VERSION '0.2.2'installs and upgrades to 0.3.0 cleanlyVERSION '0.2.2'installs and upgrades to 0.3.0 cleanlyCloses #2
🤖 Generated with Claude Code