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, androutine_parallel_safety, plus the composite typeroutine_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_textvariants), along with the mapping functionsroutine__type,routine__argument_mode,routine__volatility, androutine__parallel_safety. -
function__arg_types()andfunction__arg_types_text()are now deprecated in favor ofroutine__parse_arg_types()androutine__parse_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
relation__kind()/relation__relkind()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.
0.2.3
Fix the backwards pg_class.relkind mapping (c/f/m) in relation__kind() and
relation__relkind(). 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 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 update 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_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).
# Update Path
You must update cat_tools to 0.2.2 before upgrading PostgreSQL to version 11 or
later. Update via ALTER EXTENSION cat_tools UPDATE.
# 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 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 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:
-
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.
# Changes
-
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.
0.2.1
Fix significant problems with a previous update 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 trigger__parse()! You can get the old
behavior by passing the function_arguments output of trigger__parse()
through trigger__args_as_text(). |
0.2.0
Add function__arg_types().
Add object type functions (object__catalog(), object__reg_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 update 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.