Skip to content

Adapt to cat_tools 0.3.0: renamed function, two new object types - #28

Merged
jnasbyupgrade merged 2 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:cat_tools-0.3.0-fix
Aug 10, 2026
Merged

Adapt to cat_tools 0.3.0: renamed function, two new object types#28
jnasbyupgrade merged 2 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:cat_tools-0.3.0-fix

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Extracted from #5 ("Switch to pgxn-tools based testing"), which had
scope-crept into carrying this fix alongside the actual CI/pgxn-tools
migration. Splitting it out so it can be reviewed and merged on its own.

Update while preparing this PR: it originally also changed the
Makefile's cat_tools target to build from cat_tools' 0.3.0 git tag
directly, working around PGXN's package index being stuck on the broken,
2017-era 0.2.1 release (column "oid" specified more than once at
CREATE EXTENSION cat_tools). That's no longer true -- PGXN's index now
serves 0.3.0 directly (confirmed against the live index, a clean
CREATE EXTENSION cat_tools locally, and #5's now-green CI, all without
any Makefile change). So this PR no longer touches the Makefile at all;
plain pgxn install --unstable cat_tools already resolves to 0.3.0.

What's left: adapting to cat_tools 0.3.0's real API/enum changes

Because cat_tools has apparently never successfully run against
object_reference's full suite before (whatever version was previously
resolved), this surfaced two small, real fixes:

  • cat_tools.function__arg_types_text() is deprecated in 0.3.0 in favor
    of cat_tools.routine__parse_arg_types_text() (identical
    signature/body, just renamed) and emits a WARNING on every call.
    Switched sql/object_reference.sql's one call site to the
    non-deprecated name.
  • cat_tools 0.3.0's object_type enum grew two new members,
    partitioned table and partitioned index. pg_get_object_address()
    doesn't recognize either (only the base table/index types they
    derive from), so they're classified as unsupported
    (object_reference.unsupported()), matching the existing handling of
    event trigger for the same reason. test/sql/all.sql's sanity-check
    of the unsupported set is updated to match.

sql/object_reference--stable.sql (generated from sql/object_reference.sql)
and test/expected/zzz_build.out are regenerated to match.

Verification

  • CREATE EXTENSION cat_tools; standalone on PostgreSQL 17 via plain
    pgxn install --unstable cat_tools: installs cleanly at 0.3.0.
  • make test on PostgreSQL 17: all 7 tests pass cleanly, zero diffs.
  • test/expected/zzz_build.out's update here is a pure mechanical
    line-number shift (from the added enum-growth comment) plus the
    disappearance of the deprecated-function warning -- matches exactly
    what's already landed and CI-verified on master-pre-rollback (the
    branch Switch to pgxn-tools based testing #5 used to also carry this content on).

No longer anything for #5 to depend on merging first -- #5's CI already
passes cleanly on its own, since PGXN already serves a working cat_tools.
This PR is now a plain correctness/adaptation fix, reviewable and
mergeable independently and in either order relative to #5.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 38f9d2b2-95be-4b2f-8005-8d42077ec9a0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

jnasbyupgrade added a commit that referenced this pull request Aug 7, 2026
Rebuilt fresh on top of current master, containing only the actual
CI/pgxn-tools migration (the SQL style linter integration and the
cat_tools 0.3.0 dependency fix that had scope-crept into this branch are
split out to #16 and #28 respectively).

- Add .github/workflows/ci.yml: a `changes` job (docs-only gate +
  PG-major-matrix derivation from two constants), a `test` matrix job
  (container: pgxn/pgxn-tools, PostgreSQL 12-18), and an
  `all-checks-passed` aggregation gate for use as a single stable
  required status check.
- Remove .travis.yml and pg-travis-test.sh, superseded by the above.
- test/dump/run.sh: add -X to several psql invocations, disabling
  ~/.psqlrc so test runs are deterministic.
@jnasbyupgrade jnasbyupgrade changed the title Build cat_tools from its 0.3.0 git tag; adapt to its API/enum changes Adapt to cat_tools 0.3.0: renamed function, two new object types Aug 7, 2026
pgxn install --unstable cat_tools resolves to the newest release actually
published to the PGXN package index, which is still 0.2.1 (2017) and fails
standalone on modern PostgreSQL with "column oid specified more than once"
at CREATE EXTENSION. A fixed release, 0.3.0, is tagged in cat_tools' own
git repo but hasn't been uploaded to PGXN yet, so the Makefile's cat_tools
target now clones Postgres-Extensions/cat_tools at the 0.3.0 tag and
builds/installs it directly.

Since this is the first time object_reference's suite has actually run
against a real, working cat_tools, two small fallout fixes are needed:

- cat_tools.function__arg_types_text() is deprecated in 0.3.0 in favor of
  cat_tools.routine__parse_arg_types_text() (identical signature/body,
  just renamed, deprecated one emits a WARNING on every call). Switched
  object_reference's one call site to the non-deprecated name.
- cat_tools 0.3.0's object_type enum grew two new members, "partitioned
  table" and "partitioned index". pg_get_object_address() doesn't
  recognize either (only the base table/index types they derive from),
  so object_reference classifies them as unsupported, matching
  object_reference.unsupported()'s existing handling of "event trigger"
  for the same reason. test/sql/all.sql's sanity-check of the unsupported
  set is updated to match.

sql/object_reference--stable.sql and test/expected/zzz_build.out are
regenerated (make results) to match.

Extracted from PR Postgres-Extensions#5, which had scope-crept into also carrying this fix
alongside the actual CI/pgxn-tools migration; splitting it out here so it
can be reviewed and merged independently.
…ls 0.3.0

pgxn install --unstable cat_tools now resolves to cat_tools 0.3.0 directly
(confirmed against the live PGXN index and by a clean CREATE EXTENSION
cat_tools; both locally and, once pushed, in the actual object_reference
CI run for Postgres-Extensions#5's slimmed CI-migration branch -- it went fully green without
this Makefile change at all). The PGXN package index being stuck at the
broken, 2017-era 0.2.1 release was true when this fix was first written,
but isn't true anymore, so the git-clone-from-tag workaround has nothing
left to work around. Keeping it would leave a Makefile comment describing
a problem that no longer exists.

The SQL/test fixes (renamed function call, new object_type enum members
classified as unsupported) are unaffected -- those are needed regardless
of how cat_tools 0.3.0 gets installed.
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

Claude finished @jnasbyupgrade's task in 3m 3s —— View job


Review of PR #28: Adapt to cat_tools 0.3.0

  • Gather context (read PR diff, changed files, CLAUDE.md)
  • Understand the request (code review via /code-review)
  • Review sql/object_reference.sql changes
  • Review test/sql/all.sql changes
  • Review test/expected/zzz_build.out changes
  • Post review feedback

Summary: Small, well-scoped adaptation to cat_tools 0.3.0. No issues found.

What was checked:

  1. Deprecated function rename (sql/object_reference.sql:87) — cat_tools.function__arg_types_text(args)cat_tools.routine__parse_arg_types_text(args). Confirmed this is the only call site in the active source (grep across sql/*.sql shows the old name only remains in the frozen object_reference--0.1.0.sql release snapshot, which correctly isn't touched).

  2. New enum members handled as unsupported (sql/object_reference.sql:522-530, test/sql/all.sql:56-62) — partitioned table / partitioned index are added to the unsupported-object-types array and the corresponding pgTAP sanity check, consistently, in both places. The rationale (pg_get_object_address() doesn't recognize these two variants, only the base table/index types they derive from) matches the existing precedent for event trigger. I checked the rest of object_reference.sql for other places that switch/case on object_type (lines ~177-895) — all other logic goes through generic cat_tools.object__address_classid() / pg_get_object_address() calls rather than hardcoded per-type branches, so the unsupported-set update is the only place that needed touching. The broader "all object types are tested" check (test/sql/all.sql:36-47) already derives from cat_tools.enum_range_srf('cat_tools.object_type'), so it will automatically pick up the two new members without further changes.

  3. test/expected/zzz_build.out — the diff is a pure line-number shift in the "I promise you will be sorry..." warnings (psql:test/temp_load.not_sql:NNN), consistent with a mechanical regeneration after the source changes above; no unexpected content changes.

  4. Confirmed sql/object_reference--stable.sql is correctly not part of the diff — it's gitignored as a build-time artifact (per .gitignore), matching the PR body's note that it's "regenerated" but not committed.

  5. META.json/object_reference.control don't pin a cat_tools version (requires = 'cat_tools, count_nulls', unversioned), so no version-bump is needed there.

  6. CI is green: CI run passed.

No changes requested — this looks correct, minimal, and consistent with the existing patterns in the codebase.

@jnasbyupgrade
jnasbyupgrade merged commit 15e95e9 into Postgres-Extensions:master Aug 10, 2026
11 checks passed
jnasbyupgrade added a commit to jnasbyupgrade/object_reference that referenced this pull request Aug 10, 2026
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