Skip to content

Commit 4fe08c0

Browse files
jnasbyupgradeclaude
andcommitted
Classify partitioned table/index as unsupported, not untested
Verified directly: pg_get_object_address('partitioned table', ...) throws "unrecognized object type" -- PostgreSQL's real object-address API only knows the base "table"/"index" object types cat_tools's "partitioned table"/ "partitioned index" are derived from. object_reference actively calls pg_get_object_address() on every object_type it tracks (not just in the disabled sanity CHECK), so these two types would break identity tracking outright rather than merely lacking test coverage -- the earlier "untested" classification undersold the actual constraint. Matches the classification (and the exact reasoning/wording) already landed independently on the separate, longer-running new_features branch (PR #2), which reaches unsupported() via the same cat_tools 0.3.0 enum growth. Update test/sql/all.sql's own sanity-check of the unsupported set to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 8e59c4c commit 4fe08c0

4 files changed

Lines changed: 23 additions & 8 deletions

File tree

sql/object_reference--stable.sql

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,12 @@ SELECT __object_reference.create_function(
523523
, $body$
524524
SELECT cat_tools.objects__shared()
525525
|| cat_tools.objects__address_unsupported()
526-
|| '{event trigger}'
526+
/*
527+
* pg_get_object_address() doesn't recognize "partitioned table" or
528+
* "partitioned index" (only the base "table"/"index" types it derives
529+
* from), so object identity tracking can't round-trip them.
530+
*/
531+
|| '{event trigger, partitioned table, partitioned index}'
527532
$body$
528533
, 'Returns array of object types that are not supported.'
529534
, 'object_reference__usage'
@@ -572,8 +577,7 @@ foreign table, foreign table column, aggregate, collation, conversion, language,
572577
large object, operator, operator class, operator family, operator of access method,
573578
function of access method, rule, text search parser, text search dictionary,
574579
text search template, text search configuration, foreign-data wrapper, server,
575-
user mapping, default acl, transform, access method, extension, policy,
576-
partitioned table, partitioned index
580+
user mapping, default acl, transform, access method, extension, policy
577581
}'::cat_tools.object_type[]
578582
$body$
579583
, 'Returns array of object types that have not been tested.'

sql/object_reference.sql

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,12 @@ SELECT __object_reference.create_function(
522522
, $body$
523523
SELECT cat_tools.objects__shared()
524524
|| cat_tools.objects__address_unsupported()
525-
|| '{event trigger}'
525+
/*
526+
* pg_get_object_address() doesn't recognize "partitioned table" or
527+
* "partitioned index" (only the base "table"/"index" types it derives
528+
* from), so object identity tracking can't round-trip them.
529+
*/
530+
|| '{event trigger, partitioned table, partitioned index}'
526531
$body$
527532
, 'Returns array of object types that are not supported.'
528533
, 'object_reference__usage'
@@ -571,8 +576,7 @@ foreign table, foreign table column, aggregate, collation, conversion, language,
571576
large object, operator, operator class, operator family, operator of access method,
572577
function of access method, rule, text search parser, text search dictionary,
573578
text search template, text search configuration, foreign-data wrapper, server,
574-
user mapping, default acl, transform, access method, extension, policy,
575-
partitioned table, partitioned index
579+
user mapping, default acl, transform, access method, extension, policy
576580
}'::cat_tools.object_type[]
577581
$body$
578582
, 'Returns array of object types that have not been tested.'

test/expected/zzz_build.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ psql:test/temp_load.not_sql:512: WARNING: I promise you will be sorry if you tr
2121

2222

2323

24-
psql:test/temp_load.not_sql:620: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!
24+
psql:test/temp_load.not_sql:624: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!
2525

26-
psql:test/temp_load.not_sql:627: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!
26+
psql:test/temp_load.not_sql:631: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!
2727

2828

2929

test/sql/all.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ SELECT bag_eq(
5353
UNION -- Intentionally not UNION ALL; we want to know if object_reference.unsupported has dupes
5454
SELECT * FROM cat_tools.objects__address_unsupported_srf()
5555
UNION SELECT 'event trigger'
56+
/*
57+
* pg_identify_object_as_address() returns these as plain "table"/"index",
58+
* and pg_get_object_address() doesn't recognize "partitioned table" or
59+
* "partitioned index" at all, so the round-trip is broken.
60+
*/
61+
UNION SELECT 'partitioned table'
62+
UNION SELECT 'partitioned index'
5663
$$
5764
, 'Verify object_reference.unsupported()'
5865
);

0 commit comments

Comments
 (0)