New functions and types for working with routines and partitioned relations.
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+.
-
Added routine/function/procedure introspection support: new enum types
routine_type,routine_argument_mode,routine_volatility, androutine_parallel_safety, plus the composite typeroutine_argument. -
Added routine functions for parsing and retrieving argument information (
routineparse_arg_types,routineparse_arg_names,routinearg_types,routinearg_names, and their_textvariants), along with the mapping functionsroutinetype,routineargument_mode,routinevolatility, androutineparallel_safety. -
functionarg_types()andfunctionarg_types_text()are now deprecated in favor ofroutineparse_arg_types()androutineparse_arg_types_text(). -
Fixed a gap in the update path from 0.2.0/0.2.1: the five enum types that predate 0.2.2 (
constraint_type,procedure_type,relation_type,relation_relkind,object_type) never received theircat_tools__usageUSAGE grant when reached via that path — only a fresh 0.2.2+ install had it, sinceALTER DEFAULT PRIVILEGESonly covers objects created after it runs, and these types predate it in the legacy update scripts. The 0.2.3→0.3.0 update script now grants it retroactively. -
Corrected the
relationkind()/relationrelkind()mapping forrelkindvaluesc,f, andm(composite type, foreign table, and materialized view respectively), which were previously mapped incorrectly. -
_cat_toolshelper functions nowREVOKE EXECUTE … FROM PUBLICso they are no longer callable by roles withoutcat_tools__usage.
Fix the backwards pg_class.relkind mapping (c/f/m) in relationkind() and
relationrelkind(). Also fix binary pg_upgrade for databases updated from
0.2.0/0.2.1, whose catalog views kept columns removed in PostgreSQL 12+
(relhasoids/relhaspkey): to pg_upgrade such a cluster to PG12+, first
update the extension to 0.2.3, which rebuilds those views. The rebuild drops and
recreates public views (pg_class_v, column, pg_class()), so drop any of
your own dependent objects first. See the README "Updating the extension"
section and #42.
Compatibility release: fixes broken installs on PostgreSQL 11 and 12+, and provides an update path from 0.2.0 and 0.2.1.
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_attributegained theattmissingvalcolumn (pseudo-typeanyarray), which cannot be used as a view column. The 0.2.1 install script’sSELECT a.*frompg_attributepicks this column up and fails. -
PG 12: System catalog
oidcolumns became visible as regular columns. Views usingSELECT c.*alongside an explicitc.oidalias produce duplicate column names.
cat_tools 0.2.2 installs and updates correctly on PostgreSQL 9.2 through 18+ (all currently supported versions).
You must update cat_tools to 0.2.2 before upgrading PostgreSQL to version 11 or
later. Update via ALTER EXTENSION cat_tools UPDATE.
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 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 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.
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:
-
relhasoidswas removed frompg_catalog.pg_classin PG12. -
relhaspkeywas removed frompg_catalog.pg_classin PG17. -
attcacheoffwas removed frompg_catalog.pg_attributein 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.
-
sql/cat_tools—0.1.4—0.1.5.sqlwas empty; added-- empty updateplaceholder so PostgreSQL accepts it as a valid (no-op) update script. -
cat_tools.columnnow exposesattmissingvalastext[](cast fromanyarrayon PG 11+, orNULL::text[]on older versions). AnySELECT *oncat_tools.columnwill now include this column. -
Views rebuilt using
omit_column()to enumerate columns explicitly, avoiding both theanyarrayand duplicate-oidproblems. -
A direct
0.2.0 → 0.2.2update 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__usageis now applied on the 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_vnow explicitly omitsrelhasoids(removed in PG12) andrelhaspkey(removed in PG17) to preventpg_upgradefailures. -
(Re-release)
_cat_tools.pg_attribute_vnow explicitly omitsattcacheoff(removed in PG17) to preventpg_upgradefailures.
Fix significant problems with a previous update script.
Add pg_extension_v and related functions.
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().
|
Add function__arg_types().
Add object type functions (objectcatalog(), objectreg_type(), relation__kind(), relation_relkind()).
Add regprocedure().
=## 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.