Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
5a01ec5
Pull pgxntool from git@github.com:decibel/pgxntool.git stable
jnasbyupgrade Nov 6, 2024
81bdb18
Squashed 'pgxntool/' changes from c0af00f..bed3604
jnasbyupgrade Nov 6, 2024
d231a58
Add support for Postgres 13
jnasbyupgrade Nov 7, 2024
e8e2717
Add pgxn-tools CI
jnasbyupgrade Nov 7, 2024
0ff8a9a
Fix CI version matrix
jnasbyupgrade Nov 7, 2024
5c59f66
Remove .travis.yml
jnasbyupgrade Nov 11, 2024
ca7c8c1
Add new relkind entries
jnasbyupgrade Aug 28, 2025
700ac3b
Add relation__is_temp and relation__is_catalog functions
jnasbyupgrade Aug 29, 2025
4addd8c
Fix relation__column_names test to use temporary table instead of pg_…
jnasbyupgrade Sep 3, 2025
b1afca2
Fix missing commits
jnasbyupgrade Sep 3, 2025
3bde4a8
Add function__arg_names()
jnasbyupgrade Sep 23, 2025
c75eb40
Rename function__arg_* to routine__parse_arg_*
jnasbyupgrade Sep 23, 2025
262434f
Remove errant function from README
jnasbyupgrade Sep 23, 2025
6ad3efb
Refactor routine__arg_names() and reorganize file structure
jnasbyupgrade Sep 25, 2025
82be5ac
Add enum types for pg_proc fields and clean up permissions
jnasbyupgrade Sep 25, 2025
7a5fe71
Add missing test file
jnasbyupgrade Nov 11, 2025
21ec71b
Add automated test workflow
jnasbyupgrade Nov 11, 2025
55db3c7
Pull pgxntool from git@github.com:decibel/pgxntool.git release
jnasbyupgrade Jan 22, 2026
5332bc5
Squashed 'pgxntool/' changes from bed3604..54793a3
jnasbyupgrade Jan 22, 2026
4b86e4f
Update .gitignore from pgxntool template
jnasbyupgrade Jan 22, 2026
4c780b0
Update to new pgxntool standards
jnasbyupgrade Feb 4, 2026
65a998b
Pull pgxntool from git@github.com:decibel/pgxntool.git release
jnasbyupgrade Feb 19, 2026
5e73ee9
Squashed 'pgxntool/' changes from 54793a3..3b8cb2a
jnasbyupgrade Feb 19, 2026
5f7e573
Pull pgxntool from git@github.com:decibel/pgxntool.git release
jnasbyupgrade Feb 19, 2026
bb6146b
Squashed 'pgxntool/' changes from 3b8cb2a..639756c
jnasbyupgrade Feb 19, 2026
a4f0695
Add placeholder comment to empty upgrade file
jnasbyupgrade Feb 26, 2026
7473aa7
Fix compatibility with PostgreSQL 15+
jnasbyupgrade Apr 6, 2026
34d6fcf
Populate upgrade script from 0.2.1 to 0.3.0
jnasbyupgrade Apr 6, 2026
ab0306c
Merge origin/master into new_functions
jnasbyupgrade Apr 6, 2026
3028c8a
Squashed 'pgxntool/' changes from 639756c..121f0b3
jnasbyupgrade Apr 6, 2026
a4e8746
Pull pgxntool from git@github.com:decibel/pgxntool.git release
jnasbyupgrade Apr 6, 2026
9e73dfb
Update .gitignore after pgxntool-sync
jnasbyupgrade Apr 6, 2026
1763a93
Switch to pgxntool built-in test/build support
jnasbyupgrade Apr 6, 2026
d910a3c
Rename zzz_build.sql to build.sql
jnasbyupgrade Apr 7, 2026
3c33da3
Install rsync in CI before running tests
jnasbyupgrade Apr 7, 2026
cd75dc6
Add upgrade test and populate 0.2.1→0.3.0 upgrade script
jnasbyupgrade Apr 7, 2026
ab5f735
Fix 0.2.1 install script for PG12+ and run upgrade test unconditionally
jnasbyupgrade Apr 7, 2026
d9fd646
Revert 0.2.1.sql changes; fix upgrade test for PG12+ compatibility
jnasbyupgrade Apr 7, 2026
a3c7476
Use explicit version number in PG12+ upgrade test
jnasbyupgrade Apr 7, 2026
84e9a0d
Fix upgrade test threshold: 0.2.1 broken on PG11+ (attmissingval), no…
jnasbyupgrade Apr 7, 2026
11fcb95
Bridge 0.2.2→0.3.0 upgrade path; cast attmissingval to text::text[]
jnasbyupgrade Apr 8, 2026
4f45664
Fix upgrade test: use ERROR to suppress deprecation WARNINGs
jnasbyupgrade Apr 14, 2026
3e290be
Release cat_tools 0.2.2: fix PG11+ and PG12+ compatibility (#7)
jnasbyupgrade Apr 27, 2026
12c5596
Remove old travis file
jnasbyupgrade Apr 27, 2026
9af1f2e
Merge branch 'master' into new_functions
jnasbyupgrade Apr 27, 2026
4b18338
Fix sql/.gitignore violations: replace tracked .sql with .sql.in
jnasbyupgrade Apr 27, 2026
5366157
Update copyright to 2026
jnasbyupgrade Apr 27, 2026
e2525b0
Merge master into new_functions; resolve version/history conflicts
jnasbyupgrade Apr 27, 2026
5400e68
Consolidate permissions tests; fix pg_attribute_v format bug; expand CI
jnasbyupgrade Apr 27, 2026
f605bb4
test/upgrade-drift: add prompt files for upgrade-drift test planning
jnasbyupgrade Apr 27, 2026
f5a65d9
Drop PostgreSQL 10 support for 0.3.0
jnasbyupgrade Apr 28, 2026
3f9070d
Enforce update/upgrade terminology; add 0.3.0 history section
jnasbyupgrade Apr 28, 2026
2d5179e
Merge remote-tracking branch 'pgext/master' into new_functions
jnasbyupgrade Apr 28, 2026
752088f
Fix two CI failures introduced by merge into new_functions
jnasbyupgrade Apr 28, 2026
a1796d5
Remove dead /test/.build/ entry from .gitignore
jnasbyupgrade Apr 28, 2026
8146d5a
Fix stale build test expected output
jnasbyupgrade Apr 28, 2026
94a29b5
Fix PG11 ALTER TYPE restriction in upgrade test and CI matrix
jnasbyupgrade Apr 29, 2026
1b31c0d
Fix binary pg_upgrade compatibility: exclude relhasoids from pg_class_v
jnasbyupgrade Apr 30, 2026
7d3d367
Also omit relhaspkey from pg_class_v (removed in PG11)
jnasbyupgrade May 1, 2026
0c54003
Also omit attcacheoff from pg_attribute_v (removed in PG18)
jnasbyupgrade May 1, 2026
312a11c
Consolidate relation__ and routine__ test suites
jnasbyupgrade May 1, 2026
56b6667
Drop PG11 support: version that can't be updated to is not truly supp…
jnasbyupgrade May 1, 2026
15c6ad6
Remove accidental commits: upgrade-drift prompts and dead test/.gitig…
jnasbyupgrade May 1, 2026
124f5b0
Move function.sql tests into routine__.sql
jnasbyupgrade May 1, 2026
f3cf9a3
Move \set s to top of relation__ and routine__ test suites
jnasbyupgrade May 1, 2026
c61bc28
Restore function.sql; remove non-routine__ tests from routine__.sql
jnasbyupgrade May 1, 2026
8f6ea7b
Merge remote-tracking branch 'pgext/master' into new_functions
jnasbyupgrade May 1, 2026
c0b3eb1
Refactor test suite: helpers, dedup, consistency
jnasbyupgrade May 8, 2026
5be84a5
Address review feedback on test suite
jnasbyupgrade May 8, 2026
fcbb5b1
Further test suite refinements
jnasbyupgrade May 8, 2026
d28cf8b
Add REVOKE EXECUTE FROM PUBLIC for _cat_tools helper functions
jnasbyupgrade May 11, 2026
b4dd1a2
test/sql/routine__.sql: fix comma style, group CREATE FUNCTION with t…
jnasbyupgrade May 19, 2026
434ef45
test/sql/routine__.sql: move named_function creation to just before f…
jnasbyupgrade May 19, 2026
ec8d1e4
Address CodeRabbit review feedback for 0.3.0
jnasbyupgrade Jul 12, 2026
3d44705
Regenerate stale permissions/routine__ expected output
jnasbyupgrade Jul 12, 2026
e3db247
CI: harden version checks and fail the build on test regressions
jnasbyupgrade Jul 12, 2026
ae7c875
CI: run the extension update test on all supported versions (12–18)
jnasbyupgrade Jul 12, 2026
5ce80f9
Create _cat_tools helpers via create_function() instead of bare CREAT…
jnasbyupgrade Jul 12, 2026
3033548
test: detect when PostgreSQL adds a relkind cat_tools does not handle
jnasbyupgrade Jul 12, 2026
af30da3
CLAUDE.md: monitor CI after every push, not only PR-branch pushes
jnasbyupgrade Jul 13, 2026
b6fc753
Remove redundant client_min_messages handling from install script (fo…
jnasbyupgrade Jul 14, 2026
2417b66
test: use pgTAP set_has() for the relkind drift check
jnasbyupgrade Jul 15, 2026
a57f04c
test: share one temp table across the relation__ is_temp/is_catalog/c…
jnasbyupgrade Jul 15, 2026
eb658d1
CI: fail if the relkind drift source is empty (headers missing)
jnasbyupgrade Jul 15, 2026
271d2e5
Makefile: cache the relkind source instead of regenerating every run
jnasbyupgrade Jul 15, 2026
8347fe6
Restore upgrade-suite test capability (fresh-vs-upgrade equivalence, …
jnasbyupgrade Jul 15, 2026
e7a86d5
Makefile: quote "$@" in the relkind stamp/source recipes
jnasbyupgrade Jul 15, 2026
adb8648
Makefile: explain the order-only `| test/generated` prerequisite
jnasbyupgrade Jul 15, 2026
3510ae7
Makefile: reword relkind header-missing messages around the path, not…
jnasbyupgrade Jul 15, 2026
a1976e6
Makefile: drop stray blank line before the version-seds TODO
jnasbyupgrade Jul 15, 2026
7125b8b
test: install extension + roles once via test/install (fresh & upgrade)
jnasbyupgrade Jul 15, 2026
4e44aae
Makefile: rename test/generated -> test/.generated; define the dir re…
jnasbyupgrade Jul 15, 2026
e533923
test harness: require test_load_mode GUC; single-source, quote-forcin…
jnasbyupgrade Jul 15, 2026
831f7f9
Move versioned-SQL machinery into documented sql.mk; fix #28 DATA gap
jnasbyupgrade Jul 15, 2026
dfff40f
test harness: rename upgrade->update mode, add existing mode + update…
jnasbyupgrade Jul 16, 2026
01262b6
ci: guard existing-mode DBs against silent drop+reinstall; factor int…
jnasbyupgrade Jul 16, 2026
732d8de
ci: pg-upgrade PG10 leg validates the full bridge journey (0.2.0 → 0.…
jnasbyupgrade Jul 16, 2026
d84f3df
cat_tools 0.2.3: fix backwards relkind mapping (#36)
jnasbyupgrade Jul 17, 2026
519b3c1
Merge upstream/master (0.2.3) into new_functions
jnasbyupgrade Jul 18, 2026
72847e9
ci: disable fresh-install test-build under existing-mode --use-existing
jnasbyupgrade Jul 18, 2026
3d3f38d
test tooling: relocate existing-mode helper to bin/, refactor, and ti…
jnasbyupgrade Jul 18, 2026
3aecceb
Fix pg_upgrade update-path bug: omit_column != ANY -> != ALL, force-r…
jnasbyupgrade Jul 18, 2026
54c5211
test tooling: replace bin/test_existing symlink dispatch with explici…
jnasbyupgrade Jul 18, 2026
4d3e04b
Align update lineage with 0.2.3 re-roll: rebuild via 0.2.2→0.2.3, bri…
jnasbyupgrade Jul 19, 2026
6668771
Make 0.2.2->0.2.3 view rebuild conditional on the broken fingerprint
jnasbyupgrade Jul 20, 2026
f30432c
ci: assert 0.2.2->0.2.3 rebuild fired on the real broken path (PG10)
jnasbyupgrade Jul 20, 2026
9971895
docs: trim 0.2.3 HISTORY entry to a single concise paragraph
jnasbyupgrade Jul 20, 2026
7b2db67
docs: add formal "== Updating the extension" README section (match #42)
jnasbyupgrade Jul 20, 2026
5be076b
docs: match #42's 0.2.3 HISTORY entry verbatim (backtick identifiers)
jnasbyupgrade Jul 20, 2026
12389eb
Merge remote-tracking branch 'upstream/master' into new_functions
jnasbyupgrade Jul 20, 2026
0caf7af
Merge remote-tracking branch 'upstream/master' into new_functions
jnasbyupgrade Jul 20, 2026
5884c53
test/build/upgrade.sql: restore trailing vi modeline
jnasbyupgrade Jul 21, 2026
f310a1a
test/roles.sql: trim the header comment to the essentials
jnasbyupgrade Jul 21, 2026
09bbe0b
test/roles.sql: reframe comment — the require-quoting names catch quo…
jnasbyupgrade Jul 21, 2026
233c278
Merge remote-tracking branch 'upstream/master' into merge-master-into-16
jnasbyupgrade Jul 21, 2026
4405fd2
ci: restore a capped PG10->11 pg_upgrade leg to guard the 0.2.x updat…
jnasbyupgrade Jul 21, 2026
911c13b
ci: stop glossing "current" as the literal 0.3.0 in pg-upgrade/update…
jnasbyupgrade Jul 21, 2026
6ffa3a6
ci: add a top-level test-strategy overview before the test job
jnasbyupgrade Jul 21, 2026
c65d2df
Revert "ci: add a top-level test-strategy overview before the test job"
jnasbyupgrade Jul 21, 2026
b86c18b
ci: replace stop-early pg_upgrade machinery with a stepwise every-maj…
jnasbyupgrade Jul 21, 2026
c315571
ci: run the stepwise suite at every major from PG12, drop redundant/w…
jnasbyupgrade Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 227 additions & 59 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

86 changes: 74 additions & 12 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ Never repeat the same comment verbatim in adjacent code — write it once and re

**Always open PRs against the main repo** (`Postgres-Extensions/cat_tools`), not a fork.

## References to PRs and issues in committed files

Any reference to a GitHub PR or issue inside a **committed file** (SQL/code comments,
`.github/workflows/ci.yml` comments, `CLAUDE.md`, `test/install/load.sql`, docs) MUST be a
full URL, e.g. `https://github.com/Postgres-Extensions/cat_tools/issues/28` — never a bare
`#28` (a bare number is meaningless when the file is read outside GitHub). Referencing by
number is fine only in GitHub-native text (PR/issue titles and descriptions, review
comments).

## Pull request descriptions

The maintainer builds the squash commit message from the PR description, so the
Expand Down Expand Up @@ -72,18 +81,61 @@ Rules for what to track in git:
5. Version-specific files MUST NEVER be edited manually — always edit `sql/cat_tools.sql.in`
and regenerate.

## CI: extension-update-test matrix

The `extension-update-test` job in `.github/workflows/ci.yml` is currently restricted to
`pg: [10]` because that is the only PostgreSQL version where the pre-0.2.2 install scripts
install cleanly:
- PG 11 added `attmissingval` (pseudo-type `anyarray`) to `pg_attribute`; the old `SELECT *`
in `0.2.0`/`0.2.1` tries to include it directly, failing with "column attmissingval has
pseudo-type anyarray".
- PG 12+ exposed the `oid` system column in `SELECT *`, breaking `0.2.0`/`0.2.1` with
"column oid specified more than once".

**When working on a new version:** review and expand this matrix. The new version's install
## CI: PostgreSQL version support

**Policy:** Never support a fresh install on any PostgreSQL version where the extension
update path is known to be broken — a version that cannot be updated to is not truly
supported.

Both PG10 and PG11 are dropped as of 0.3.0. The `ALTER TYPE ... ADD VALUE` statements in
the update script cannot run inside an extension update script on PG11 or earlier
(PROCESS_UTILITY_QUERY context); this restriction was lifted in PG12. Because a version
that cannot be updated to is not truly supported, PG10 and PG11 support is dropped
entirely. cat_tools 0.3.0 supports PG12+.

### Test-load modes (`TEST_LOAD_SOURCE`)

`test/install/load.sql` installs the suite's dependencies once, committed, before the pgTAP
suite. The Makefile exports the mode (and update range) as placeholder GUCs via `PGOPTIONS`;
`TEST_LOAD_SOURCE` must be `fresh`, `update`, or `existing` (anything else is a hard
parse-time error):

- **fresh** (default): `CREATE EXTENSION cat_tools` at the current version.
- **update**: `CREATE EXTENSION` at `TEST_UPDATE_FROM` (default `0.2.2`) then
`ALTER EXTENSION cat_tools UPDATE` — to `TEST_UPDATE_TO` if set, else to the current
version. Running the SAME suite/expected output asserts an updated database behaves
identically to a fresh install. `make test-update` is the shorthand.
- **existing**: the extension is ALREADY installed (by binary `pg_upgrade`, or an
`ALTER EXTENSION UPDATE` performed outside the suite). load.sql does not touch it; it only
asserts presence + current version and creates the test roles. Pair with
`CONTRIB_TESTDB=<db> EXTRA_REGRESS_OPTS=--use-existing` so `pg_regress` runs against that
database instead of dropping/recreating a throwaway one.

### CI jobs

- `extension-update-test` exercises the widest update path we support — `0.2.2` → current
in `update` mode — on `pg: [12..18]`, plus a PG10-only leg that exercises the pre-0.2.2
update scripts (`0.2.0`→`0.2.2` and `0.2.1`→`0.2.2`, which install only on PG10 and target
`0.2.2`, not the current version). `0.2.2` is the update-from floor only for backward-compat:
the 0.2.0/0.2.1 install scripts fail on PG11+/PG12+. PG12 is the PostgreSQL floor — PG11 and
earlier cannot run `ALTER TYPE ... ADD VALUE` in extension update scripts (lifted in PG12).
- `pg-upgrade-test` binary-`pg_upgrade`s a real database and then runs the suite against it
in `existing` mode. Two shapes:
- `old_pg>=11`: install `0.2.2` directly → plant guard → pg_upgrade → update to current.
A *fresh* `0.2.2` install builds the views with the pg_upgrade-safe `omit_column` (`!= ALL`),
so it survives pg_upgrade as-is.
- `old_pg=10`: the FULL real-world journey — install `0.2.0`, **bridge-update to `0.2.3` on
the old cluster** → plant guard → pg_upgrade → update to current. The bridge must reach
`0.2.3`, not `0.2.2`: the shipped `0.2.0`→`0.2.2` / `0.2.1`→`0.2.2` scripts do NOT fix the
views (their `omit_column` used the no-op `!= ANY`, leaving `relhasoids`/`relhaspkey` in
`_cat_tools.pg_class_v`); the pg_class_v DROP+CREATE rebuild that strips those columns lives
in the `0.2.2`→`0.2.3` update. `0.2.3` is also the furthest a PG10 cluster can reach
(`0.2.3`→`0.3.0` uses `ALTER TYPE ... ADD VALUE`, unrunnable in an update script before
PG12); the post-upgrade step then updates `0.2.3`→current on the new cluster. This proves a
`0.2.3` reached via the bridge update (not a fresh install) survives pg_upgrade.
Both flows plant the dependency guard and run through `bin/test_existing`.

**When working on a new version:** review and expand these matrices. A new version's install
script may support more PG versions, enabling testing of the update path from older
cat_tools versions on newer PostgreSQL.

Expand All @@ -101,6 +153,16 @@ Always use block comment format for multi-line comments in SQL files:

Never use `--` line comments for multi-line explanations.

### Closing non-indentable blocks
When closing a code block that cannot be indented to show its nesting (e.g. SQL
`\endif`, `DO $$...$$`, shell heredocs, column-0 `fi`/`esac`) AND that block
contains nested blocks, label the closer with a comment naming which block it
closes — e.g. shell `esac # basename dispatch`, or a named dollar-quote
`DO $DO$ ... $DO$` for a DO block. Where the language rejects a trailing comment
on the closer (psql `\endif` warns "extra argument ignored"), put the label on
the immediately following line instead (e.g. `\endif` then
`-- end \if :cat_tools_mode_existing`).

### Terminology
"upgrade" refers to a PostgreSQL cluster (`pg_upgrade`); "update" refers to an extension
(`ALTER EXTENSION ... UPDATE`). cat_tools' version-to-version scripts are "update scripts" —
Expand Down
62 changes: 47 additions & 15 deletions HISTORY.asc
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
0.3.0
-----
New functions and types for working with routines and partitioned relations.

### PostgreSQL Version Support

**PostgreSQL 10 and 11 are no longer supported** as of this release. The 0.2.3→0.3.0
update script adds values to existing enum types (`ALTER TYPE ... ADD VALUE`), which
cannot run inside an extension update script on PG11 or earlier (a restriction lifted
in PG12). Because a version that cannot be updated to is not truly supported, PG10 and
PG11 support is dropped entirely.

cat_tools 0.3.0 supports **PostgreSQL 12 through 18+**.

### Changes

* Added routine/function/procedure introspection support: new enum types
`routine_type`, `routine_argument_mode`, `routine_volatility`, and
`routine_parallel_safety`, plus the composite type `routine_argument`.
* Added routine functions for parsing and retrieving argument information
(`routine__parse_arg_types`, `routine__parse_arg_names`, `routine__arg_types`,
`routine__arg_names`, and their `_text` variants), along with the mapping
functions `routine__type`, `routine__argument_mode`, `routine__volatility`,
and `routine__parallel_safety`.
* `function__arg_types()` and `function__arg_types_text()` are now deprecated in
favor of `routine__parse_arg_types()` and `routine__parse_arg_types_text()`.
* Corrected the `relation__kind()` / `relation__relkind()` mapping for `relkind`
values `c`, `f`, and `m` (composite type, foreign table, and materialized
view respectively), which were previously mapped incorrectly.
* `_cat_tools` helper functions now `REVOKE EXECUTE ... FROM PUBLIC` so they are
no longer callable by roles without `cat_tools__usage`.

0.2.3
-----
Fix the backwards `pg_class.relkind` mapping (c/f/m) in `relation__kind()` and
Expand All @@ -13,7 +45,7 @@ section and https://github.com/Postgres-Extensions/cat_tools/pull/42.
0.2.2
-----
Compatibility release: fixes broken installs on PostgreSQL 11 and 12+, and
provides an upgrade path from 0.2.0 and 0.2.1.
provides an update path from 0.2.0 and 0.2.1.


### PostgreSQL Version Support
Expand All @@ -27,24 +59,24 @@ It fails on newer versions due to catalog schema changes:
* **PG 12**: System catalog `oid` columns became visible as regular columns. Views
using `SELECT c.*` alongside an explicit `c.oid` alias produce duplicate column names.

cat_tools 0.2.2 installs and upgrades correctly on **PostgreSQL 9.2 through 18+**
cat_tools 0.2.2 installs and updates correctly on **PostgreSQL 9.2 through 18+**
(all currently supported versions).

### Upgrade Path
### Update Path

**You must upgrade cat_tools to 0.2.2 before upgrading PostgreSQL to version 11 or
later.** Upgrade via `ALTER EXTENSION cat_tools UPDATE`.
**You must update cat_tools to 0.2.2 before upgrading PostgreSQL to version 11 or
later.** Update via `ALTER EXTENSION cat_tools UPDATE`.

### Upgrade Warning: Objects Depending on `cat_tools.column`
### Update Warning: Objects Depending on `cat_tools.column`

`cat_tools.column` in 0.2.0 and 0.2.1 had extra columns: an unqualified `SELECT *`
across a `LEFT JOIN pg_constraint` accidentally pulled in all `pg_constraint` columns
(`conname`, `contype`, etc.). The 0.2.2 upgrade fixes the column list by dropping and
(`conname`, `contype`, etc.). The 0.2.2 update fixes the column list by dropping and
recreating `cat_tools.column` (and its underlying `_cat_tools.column`).

**If you have created any views, functions, or other objects that depend on
`cat_tools.column`, you must drop them before upgrading and recreate them
afterward.** The upgrade will fail with an error if any such dependent objects
`cat_tools.column`, you must drop them before updating and recreate them
afterward.** The update will fail with an error if any such dependent objects
exist — this is intentional, to avoid silently breaking user-defined objects.
After dropping your dependent objects, run `ALTER EXTENSION cat_tools UPDATE` again.

Expand All @@ -68,25 +100,25 @@ to PostgreSQL 12 or later.**

### Changes

* `sql/cat_tools--0.1.4--0.1.5.sql` was empty; added `-- empty upgrade` placeholder so
PostgreSQL accepts it as a valid (no-op) upgrade script.
* `sql/cat_tools--0.1.4--0.1.5.sql` was empty; added `-- empty update` placeholder so
PostgreSQL accepts it as a valid (no-op) update script.
* `cat_tools.column` now exposes `attmissingval` as `text[]` (cast from `anyarray` on
PG 11+, or `NULL::text[]` on older versions). Any `SELECT *` on `cat_tools.column`
will now include this column.
* Views rebuilt using `omit_column()` to enumerate columns explicitly, avoiding both the
`anyarray` and duplicate-`oid` problems.
* A direct `0.2.0 → 0.2.2` upgrade path is provided (`cat_tools--0.2.0--0.2.2.sql`),
* A direct `0.2.0 → 0.2.2` update path is provided (`cat_tools--0.2.0--0.2.2.sql`),
which also applies all 0.2.1 function additions in a single step.
* `GRANT SELECT ON cat_tools.pg_extension_v TO cat_tools__usage` is now applied on the
upgrade path from 0.2.0 (it was absent in 0.2.0 and only added via the 0.2.1 upgrade).
update path from 0.2.0 (it was absent in 0.2.0 and only added via the 0.2.1 update).
* (Re-release) `_cat_tools.pg_class_v` now explicitly omits `relhasoids` (removed in PG12)
and `relhaspkey` (removed in PG17) to prevent `pg_upgrade` failures.
* (Re-release) `_cat_tools.pg_attribute_v` now explicitly omits `attcacheoff` (removed in
PG17) to prevent `pg_upgrade` failures.

0.2.1
-----
Fix significant problems with a previous upgrade script.
Fix significant problems with a previous update script.

Add pg_extension_v and related functions.

Expand Down Expand Up @@ -126,7 +158,7 @@ objects would cascede to the extension itself.

0.1.2
-----
=## BUGFIX: Install upgrade script
=## BUGFIX: Install update script

0.1.1
-----
Expand Down
6 changes: 3 additions & 3 deletions META.in.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "cat_tools",

"X_comment": "REQUIRED. Version of the distribution. http://pgxn.org/spec/#version",
"version": "0.2.3",
"version": "0.3.0",

"X_comment": "REQUIRED. Short description of distribution.",
"abstract": "Tools for interfacing with the Postgres catalog",
Expand All @@ -37,7 +37,7 @@
"file": "sql/cat_tools.sql",

"X_comment": "REQUIRED. Version the extension is at.",
"version": "0.2.3",
"version": "0.3.0",

"X_comment": "Optional: \"abstract\": Description of the extension.",
"abstract": "Tools for interfacing with the catalog",
Expand Down Expand Up @@ -72,7 +72,7 @@

"build": {
"requires": {
"PostgreSQL": "9.2.0"
"PostgreSQL": "12.0"
}
},
"runtime": {
Expand Down
6 changes: 3 additions & 3 deletions META.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "cat_tools",

"X_comment": "REQUIRED. Version of the distribution. http://pgxn.org/spec/#version",
"version": "0.2.3",
"version": "0.3.0",

"X_comment": "REQUIRED. Short description of distribution.",
"abstract": "Tools for interfacing with the Postgres catalog",
Expand All @@ -37,7 +37,7 @@
"file": "sql/cat_tools.sql",

"X_comment": "REQUIRED. Version the extension is at.",
"version": "0.2.3",
"version": "0.3.0",

"X_comment": "Optional: \"abstract\": Description of the extension.",
"abstract": "Tools for interfacing with the catalog",
Expand Down Expand Up @@ -72,7 +72,7 @@

"build": {
"requires": {
"PostgreSQL": "9.2.0"
"PostgreSQL": "12.0"
}
},
"runtime": {
Expand Down
20 changes: 13 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ PGXNTOOL_ENABLE_TEST_INSTALL = yes
# is a hard error at parse time (so e.g. `make test TEST_LOAD_SOURCE=typo` fails
# fast rather than defaulting).
#
# The install runs COMMITTED (in test/install, not in deps.sql's per-test
# transaction) so it happens once, before the suite, and persists into every
# rolled-back test. See test/install/load.sql.
# An update must be committed (which is why it lives in test/install, not in
# deps.sql's per-test transaction): the update to the current version runs
# ALTER TYPE ... ADD VALUE, and a newly added enum value cannot be USED in the
# transaction that added it (55P04). See test/install/load.sql.
#
# update mode requires PG12+ when it targets the current version (ALTER TYPE
# ... ADD VALUE cannot run in a transaction at all before PG12); CI restricts it
# accordingly.
TEST_LOAD_SOURCE ?= fresh
ifeq ($(filter $(TEST_LOAD_SOURCE),fresh update existing),)
$(error TEST_LOAD_SOURCE must be 'fresh', 'update' or 'existing', got '$(TEST_LOAD_SOURCE)')
Expand All @@ -60,10 +65,11 @@ export PGOPTIONS := $(PGOPTIONS) -c cat_tools.test_load_mode=$(TEST_LOAD_SOURCE)
test-update:
$(MAKE) test TEST_LOAD_SOURCE=update

# Versioned SQL is generated from .sql.in at build time. That generation and the
# DATA list that installs it live in sql.mk, which also owns
# `include pgxntool/base.mk` (base.mk has no include guard, so it must be
# included exactly once; sql.mk includes it at its top). sql.mk documents the
# Versioned SQL is generated from .sql.in at build time. That generation, the
# DATA list that installs it, and the relkind drift source all live in sql.mk,
# which also owns `include pgxntool/base.mk` (base.mk has no include guard, so it
# must be included exactly once; sql.mk includes it at its top). This Makefile
# therefore does NOT include base.mk itself -- only sql.mk. sql.mk documents the
# GNU Make two-phase (parse vs. recipe) hazards involved (e.g.
# https://github.com/Postgres-Extensions/cat_tools/issues/28) and relies on
# base.mk/control.mk/PGXS vars (EXTENSION_VERSION_FILES, PG_CONFIG, MAJORVER,
Expand Down
Loading
Loading