Skip to content

Latest commit

 

History

History
126 lines (94 loc) · 5.02 KB

File metadata and controls

126 lines (94 loc) · 5.02 KB

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.

PostgreSQL Version Support

cat_tools 0.2.1 (and earlier) only installs correctly on PostgreSQL 9.2 – 10. It fails on newer versions due to catalog schema changes:

  • PG 11: pg_attribute gained the attmissingval column (pseudo-type anyarray), which cannot be used as a view column. The 0.2.1 install script’s SELECT a.* from pg_attribute picks this column up and fails.

  • 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+ (all currently supported versions).

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

Upgrade 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 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 exist — this is intentional, to avoid silently breaking user-defined objects. After dropping your dependent objects, run ALTER EXTENSION cat_tools UPDATE again.

pg_upgrade Compatibility (Re-release)

pg_upgrade physically copies data files and re-applies schema definitions on the new cluster. Any view that references a catalog column removed in the new PostgreSQL version will cause the upgrade to fail. The initial 0.2.2 release omitted oid and attmissingval from the catalog views, but missed several columns that were later removed from PostgreSQL:

  • relhasoids was removed from pg_catalog.pg_class in PG12.

  • relhaspkey was removed from pg_catalog.pg_class in PG17.

  • attcacheoff was removed from pg_catalog.pg_attribute in PG17.

Without this fix, running pg_upgrade across any of these version boundaries with cat_tools installed would fail.

You must have the re-release of 0.2.2 installed before running pg_upgrade 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.

  • 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), 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).

  • (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.

Add pg_extension_v and related functions.

Improvements to trigger__parse()

Add output fields for the table a trigger is on, as well as the function the trigger is using. Based on work done by Luís Lizardo (https://github.com/lizardoluis).

Warning
This changes the behavior of triggerparse()! You can get the old behavior by passing the function_arguments output of triggerparse() through trigger__args_as_text().

0.2.0

Add function__arg_types().

Add object type functions (objectcatalog(), objectreg_type(), relation__kind(), relation_relkind()).

Add regprocedure().

0.1.5

Add support for Postgres 9.1 and 9.2

Note
There are no SQL changes in this version.

0.1.4

=## BUGFIX: Fix trigger__get_oid()

0.1.3

=## BUGFIX: Drop pg_temp objects created by extension

It was not possible to actually install 0.1.2 and 0.1.1 because they left temporary objects behind. During session cleanup, the cascade drop of those objects would cascede to the extension itself.

0.1.2

=## BUGFIX: Install upgrade script

0.1.1

=## Add cat_tools__usage role

Previously, granting permissions to use these tools was difficult. Now all you need to do is grant cat_tools__usage to roles that you would like to have access to these tools. Keep in mind they are not meant for use by people, only by code.