agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFix DROP PROPERTY GRAPH "unsupported object class" error
31+ messages / 6 participants
[nested] [flat]
* Fix DROP PROPERTY GRAPH "unsupported object class" error
@ 2026-04-22 16:19 Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 31+ messages in thread
From: Bertrand Drouvot @ 2026-04-22 16:19 UTC (permalink / raw)
To: pgsql-hackers@lists.postgresql.org; +Cc: Peter Eisentraut <peter@eisentraut.org>; Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Hi hackers,
While testing the Property Graphs, I observed that DROP PROPERTY GRAPH could
generate the "unsupported object class" error.
Indeed, getObjectTypeDescription() and getObjectIdentityParts() are missing switch
cases for PropgraphElementLabelRelationId and PropgraphLabelPropertyRelationId,
causing DROP PROPERTY GRAPH to hit the default case and error out with
"unsupported object class".
The bug only manifests when an event trigger is active, because that is what
calls these functions.
The attached adds the missing cases so that DROP PROPERTY GRAPH, DROP PROPERTY GRAPH
IF EXISTS, and DROP SCHEMA CASCADE on schemas containing property graphs all work
correctly when event triggers are present.
It also adds test cases that create an event trigger and then exercise DROP PROPERTY
GRAPH and DROP SCHEMA CASCADE with property graphs.
I think that's worth an open item and I'll add one for this issue.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Attachments:
[text/x-diff] v1-0001-Fix-DROP-PROPERTY-GRAPH-unsupported-object-class-.patch (8.4K, ../../aej1DkLwhyZWmtxJ@bdtpg/2-v1-0001-Fix-DROP-PROPERTY-GRAPH-unsupported-object-class-.patch)
download | inline diff:
From bc81c1002bad4b556644152754c03d31a2c89ee7 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Wed, 22 Apr 2026 15:01:12 +0000
Subject: [PATCH v1] Fix DROP PROPERTY GRAPH "unsupported object class" error
getObjectTypeDescription() and getObjectIdentityParts() are missing switch cases
for PropgraphElementLabelRelationId and PropgraphLabelPropertyRelationId, causing
DROP PROPERTY GRAPH to hit the default case and error out with
"unsupported object class".
The bug only manifests when an event trigger is active, because that is what
calls these functions.
This commit adds the missing cases so that DROP PROPERTY GRAPH, DROP PROPERTY GRAPH
IF EXISTS, and DROP SCHEMA CASCADE on schemas containing property graphs all work
correctly when event triggers are present.
It also adds test cases that create an event trigger and then exercise DROP PROPERTY
GRAPH and DROP SCHEMA CASCADE with property graphs.
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
---
src/backend/catalog/objectaddress.c | 93 +++++++++++++++++++
.../expected/create_property_graph.out | 36 +++++++
.../regress/sql/create_property_graph.sql | 36 +++++++
3 files changed, 165 insertions(+)
54.5% src/backend/catalog/
24.2% src/test/regress/expected/
21.1% src/test/regress/sql/
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index c1862809577..e2d6d8f71f6 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -4901,10 +4901,18 @@ getObjectTypeDescription(const ObjectAddress *object, bool missing_ok)
appendStringInfoString(&buffer, "policy");
break;
+ case PropgraphElementLabelRelationId:
+ appendStringInfoString(&buffer, "property graph element label");
+ break;
+
case PropgraphElementRelationId:
appendStringInfoString(&buffer, "property graph element");
break;
+ case PropgraphLabelPropertyRelationId:
+ appendStringInfoString(&buffer, "property graph label property");
+ break;
+
case PropgraphLabelRelationId:
appendStringInfoString(&buffer, "property graph label");
break;
@@ -6161,6 +6169,49 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
+ case PropgraphElementLabelRelationId:
+ {
+ Relation ellabelDesc;
+ ScanKeyData skey[1];
+ SysScanDesc ellabelscan;
+ HeapTuple tup;
+ Form_pg_propgraph_element_label pgelform;
+ ObjectAddress oa;
+
+ ellabelDesc = table_open(PropgraphElementLabelRelationId, AccessShareLock);
+ ScanKeyInit(&skey[0],
+ Anum_pg_propgraph_element_label_oid,
+ BTEqualStrategyNumber, F_OIDEQ,
+ ObjectIdGetDatum(object->objectId));
+
+ ellabelscan = systable_beginscan(ellabelDesc,
+ PropgraphElementLabelObjectIndexId,
+ true, NULL, 1, skey);
+
+ tup = systable_getnext(ellabelscan);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for element label %u",
+ object->objectId);
+
+ systable_endscan(ellabelscan);
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ pgelform = (Form_pg_propgraph_element_label) GETSTRUCT(tup);
+
+ ObjectAddressSet(oa, PropgraphElementRelationId, pgelform->pgelelid);
+
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+
+ systable_endscan(ellabelscan);
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
case PropgraphElementRelationId:
{
HeapTuple tup;
@@ -6184,6 +6235,48 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
+ case PropgraphLabelPropertyRelationId:
+ {
+ Relation lblpropDesc;
+ ScanKeyData skey[1];
+ SysScanDesc lblpropscan;
+ HeapTuple tup;
+ Form_pg_propgraph_label_property plpform;
+ ObjectAddress oa;
+
+ lblpropDesc = table_open(PropgraphLabelPropertyRelationId,
+ AccessShareLock);
+ ScanKeyInit(&skey[0],
+ Anum_pg_propgraph_label_property_oid,
+ BTEqualStrategyNumber, F_OIDEQ,
+ ObjectIdGetDatum(object->objectId));
+
+ lblpropscan = systable_beginscan(lblpropDesc, PropgraphLabelPropertyObjectIndexId,
+ true, NULL, 1, skey);
+
+ tup = systable_getnext(lblpropscan);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for label property %u",
+ object->objectId);
+
+ systable_endscan(lblpropscan);
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
+ plpform = (Form_pg_propgraph_label_property) GETSTRUCT(tup);
+
+ ObjectAddressSet(oa, PropgraphElementLabelRelationId, plpform->plpellabelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+
+ systable_endscan(lblpropscan);
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
case PropgraphLabelRelationId:
{
HeapTuple tup;
diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out
index bc9a596ec89..942a1294b15 100644
--- a/src/test/regress/expected/create_property_graph.out
+++ b/src/test/regress/expected/create_property_graph.out
@@ -922,5 +922,41 @@ ALTER PROPERTY GRAPH IF EXISTS g1 SET SCHEMA create_property_graph_tests_2;
NOTICE: relation "g1" does not exist, skipping
DROP PROPERTY GRAPH IF EXISTS g1;
NOTICE: property graph "g1" does not exist, skipping
+-- Test DROP PROPERTY GRAPH with dependency resolution
+RESET search_path;
+CREATE FUNCTION dpg_evt_func() RETURNS event_trigger
+LANGUAGE plpgsql AS $$
+BEGIN END;
+$$;
+CREATE EVENT TRIGGER dpg_evt ON ddl_command_end EXECUTE FUNCTION dpg_evt_func();
+CREATE TABLE dpg_t1 (id int PRIMARY KEY, val text);
+CREATE TABLE dpg_t2 (id int PRIMARY KEY, src int, dst int);
+CREATE PROPERTY GRAPH dpg_test
+ VERTEX TABLES (dpg_t1 KEY (id) LABEL person PROPERTIES (val AS name))
+ EDGE TABLES (dpg_t2 KEY (id)
+ SOURCE KEY (src) REFERENCES dpg_t1 (id)
+ DESTINATION KEY (dst) REFERENCES dpg_t1 (id)
+ LABEL knows);
+DROP PROPERTY GRAPH dpg_test;
+-- table survives graph drop
+SELECT COUNT(*) FROM dpg_t1;
+ count
+-------
+ 0
+(1 row)
+
+DROP TABLE dpg_t1, dpg_t2;
+-- Test DROP SCHEMA CASCADE with property graphs inside
+CREATE SCHEMA dpg_schema;
+SET search_path = dpg_schema;
+CREATE TABLE t (id int PRIMARY KEY);
+CREATE PROPERTY GRAPH g VERTEX TABLES (t KEY (id));
+RESET search_path;
+DROP SCHEMA dpg_schema CASCADE;
+NOTICE: drop cascades to 2 other objects
+DETAIL: drop cascades to table dpg_schema.t
+drop cascades to property graph dpg_schema.g
+DROP EVENT TRIGGER dpg_evt;
+DROP FUNCTION dpg_evt_func;
DROP ROLE regress_graph_user1, regress_graph_user2;
-- leave remaining objects behind for pg_upgrade/pg_dump tests
diff --git a/src/test/regress/sql/create_property_graph.sql b/src/test/regress/sql/create_property_graph.sql
index 241f93df302..857098dadc8 100644
--- a/src/test/regress/sql/create_property_graph.sql
+++ b/src/test/regress/sql/create_property_graph.sql
@@ -360,6 +360,42 @@ ALTER PROPERTY GRAPH g1 ADD VERTEX TABLES (t1 KEY (a)); -- error
ALTER PROPERTY GRAPH IF EXISTS g1 SET SCHEMA create_property_graph_tests_2;
DROP PROPERTY GRAPH IF EXISTS g1;
+
+-- Test DROP PROPERTY GRAPH with dependency resolution
+
+RESET search_path;
+CREATE FUNCTION dpg_evt_func() RETURNS event_trigger
+LANGUAGE plpgsql AS $$
+BEGIN END;
+$$;
+
+CREATE EVENT TRIGGER dpg_evt ON ddl_command_end EXECUTE FUNCTION dpg_evt_func();
+
+CREATE TABLE dpg_t1 (id int PRIMARY KEY, val text);
+CREATE TABLE dpg_t2 (id int PRIMARY KEY, src int, dst int);
+CREATE PROPERTY GRAPH dpg_test
+ VERTEX TABLES (dpg_t1 KEY (id) LABEL person PROPERTIES (val AS name))
+ EDGE TABLES (dpg_t2 KEY (id)
+ SOURCE KEY (src) REFERENCES dpg_t1 (id)
+ DESTINATION KEY (dst) REFERENCES dpg_t1 (id)
+ LABEL knows);
+DROP PROPERTY GRAPH dpg_test;
+
+-- table survives graph drop
+SELECT COUNT(*) FROM dpg_t1;
+DROP TABLE dpg_t1, dpg_t2;
+
+-- Test DROP SCHEMA CASCADE with property graphs inside
+CREATE SCHEMA dpg_schema;
+SET search_path = dpg_schema;
+CREATE TABLE t (id int PRIMARY KEY);
+CREATE PROPERTY GRAPH g VERTEX TABLES (t KEY (id));
+RESET search_path;
+DROP SCHEMA dpg_schema CASCADE;
+
+DROP EVENT TRIGGER dpg_evt;
+DROP FUNCTION dpg_evt_func;
+
DROP ROLE regress_graph_user1, regress_graph_user2;
-- leave remaining objects behind for pg_upgrade/pg_dump tests
--
2.34.1
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
@ 2026-04-23 06:39 ` Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
0 siblings, 1 reply; 31+ messages in thread
From: Michael Paquier @ 2026-04-23 06:39 UTC (permalink / raw)
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; +Cc: pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>; Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
On Wed, Apr 22, 2026 at 04:19:26PM +0000, Bertrand Drouvot wrote:
> Indeed, getObjectTypeDescription() and getObjectIdentityParts() are missing switch
> cases for PropgraphElementLabelRelationId and PropgraphLabelPropertyRelationId,
> causing DROP PROPERTY GRAPH to hit the default case and error out with
> "unsupported object class".
Hmm. Couldn't these code paths be reached as well with the object
functions like pg_describe_object(), pg_get_object_address(),
pg_identify_object_as_address() or pg_identify_object()? Object
descriptions usually stick within object_address.sql. The new objects
you would want to stick should be covered as well in this test suite,
and the file already has some property graphs in it.
> The bug only manifests when an event trigger is active, because that is what
> calls these functions.
--- a/src/test/regress/expected/create_property_graph.out
+++ b/src/test/regress/expected/create_property_graph.out
[...]
+CREATE EVENT TRIGGER dpg_evt ON ddl_command_end EXECUTE FUNCTION dpg_evt_func();
Event triggers are avoided in parallel groups because they are not
reliable (see also fast_default), and we should avoid what you are
doing in this test.
> The attached adds the missing cases so that DROP PROPERTY GRAPH, DROP PROPERTY GRAPH
> IF EXISTS, and DROP SCHEMA CASCADE on schemas containing property graphs all work
> correctly when event triggers are present.
>
> It also adds test cases that create an event trigger and then exercise DROP PROPERTY
> GRAPH and DROP SCHEMA CASCADE with property graphs.
>
> I think that's worth an open item and I'll add one for this issue.
This should be an open item, I guess, yes. Could you add one? Even
if Peter discards the issue at the end, the issue still needs to be
discussed so we had better to track it anyway.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../aem-pjK57peuLI-x@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
@ 2026-04-23 07:27 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
0 siblings, 1 reply; 31+ messages in thread
From: Ashutosh Bapat @ 2026-04-23 07:27 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; +Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>
On Thu, Apr 23, 2026 at 12:09 PM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Wed, Apr 22, 2026 at 04:19:26PM +0000, Bertrand Drouvot wrote:
> > Indeed, getObjectTypeDescription() and getObjectIdentityParts() are missing switch
> > cases for PropgraphElementLabelRelationId and PropgraphLabelPropertyRelationId,
> > causing DROP PROPERTY GRAPH to hit the default case and error out with
> > "unsupported object class".
>
> Hmm. Couldn't these code paths be reached as well with the object
> functions like pg_describe_object(), pg_get_object_address(),
> pg_identify_object_as_address() or pg_identify_object()? Object
> descriptions usually stick within object_address.sql. The new objects
> you would want to stick should be covered as well in this test suite,
> and the file already has some property graphs in it.
+1. See emails around [1] for some discussion about existing property
graph object definitions.
>
> > The bug only manifests when an event trigger is active, because that is what
> > calls these functions.
>
> --- a/src/test/regress/expected/create_property_graph.out
> +++ b/src/test/regress/expected/create_property_graph.out
> [...]
> +CREATE EVENT TRIGGER dpg_evt ON ddl_command_end EXECUTE FUNCTION dpg_evt_func();
>
> Event triggers are avoided in parallel groups because they are not
> reliable (see also fast_default), and we should avoid what you are
> doing in this test.
>
> > The attached adds the missing cases so that DROP PROPERTY GRAPH, DROP PROPERTY GRAPH
> > IF EXISTS, and DROP SCHEMA CASCADE on schemas containing property graphs all work
> > correctly when event triggers are present.
> >
> > It also adds test cases that create an event trigger and then exercise DROP PROPERTY
> > GRAPH and DROP SCHEMA CASCADE with property graphs.
There are already tests for DROP PROPERTY GRAPH and DROP PROPERTY
GRAPH IF EXISTS.
We don't have DROP SCHEMA CASCADE tests in create_table.sql or
create_function.sql. It seems like we don't explicitly test it for
every object separately. Why do we want to add it for property graphs
then?
I could reproduce your issue with a smaller change to the file
diff --git a/src/test/regress/sql/create_property_graph.sql
b/src/test/regress/sql/create_property_graph.sql
index 4cf771596a8..d9cbdf9f1a9 100644
--- a/src/test/regress/sql/create_property_graph.sql
+++ b/src/test/regress/sql/create_property_graph.sql
@@ -151,6 +151,11 @@ CREATE PROPERTY GRAPH gx
t1x KEY (a) PROPERTIES (b::varchar(20) AS p1),
t2x KEY (i) PROPERTIES (j::varchar(20) AS p1) -- matching
typmods by casting works
);
+CREATE FUNCTION gx_evt_func() RETURNS event_trigger
+LANGUAGE plpgsql AS $$
+BEGIN END;
+$$;
+CREATE EVENT TRIGGER gx_evt ON ddl_command_end EXECUTE FUNCTION gx_evt_func();
DROP PROPERTY GRAPH gx;
DROP TABLE t1x, t2x;
That covers everything you want to test and its minimal change to the
test. But I see that the event triggers for all objects are tested in
event_triggers.sql. So I think the new test should be added to that
file.
> >
> > I think that's worth an open item and I'll add one for this issue.
>
> This should be an open item, I guess, yes. Could you add one? Even
> if Peter discards the issue at the end, the issue still needs to be
> discussed so we had better to track it anyway.
Element label, label property are not user visible objects per say, so
I am not sure whether the code changes are in the right direction. But
it's also true that we shouldn't get an error in the presence of an
event trigger. We need to fix that.
[1] https://www.postgresql.org/message-id/CAExHW5sgVFHWYkcxZjH0LF4Qbyx2Zyri5ZLave7tZdMbvTLiqg@mail.gmail...
--
Best Wishes,
Ashutosh Bapat
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
@ 2026-04-23 11:01 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
0 siblings, 1 reply; 31+ messages in thread
From: Bertrand Drouvot @ 2026-04-23 11:01 UTC (permalink / raw)
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>
Hi,
On Thu, Apr 23, 2026 at 12:57:37PM +0530, Ashutosh Bapat wrote:
> On Thu, Apr 23, 2026 at 12:09 PM Michael Paquier <michael@paquier.xyz> wrote:
> >
> > On Wed, Apr 22, 2026 at 04:19:26PM +0000, Bertrand Drouvot wrote:
> > > Indeed, getObjectTypeDescription() and getObjectIdentityParts() are missing switch
> > > cases for PropgraphElementLabelRelationId and PropgraphLabelPropertyRelationId,
> > > causing DROP PROPERTY GRAPH to hit the default case and error out with
> > > "unsupported object class".
> >
> > Hmm. Couldn't these code paths be reached as well with the object
> > functions like pg_describe_object(), pg_get_object_address(),
> > pg_identify_object_as_address() or pg_identify_object()? Object
> > descriptions usually stick within object_address.sql. The new objects
> > you would want to stick should be covered as well in this test suite,
> > and the file already has some property graphs in it.
>
> +1. See emails around [1] for some discussion about existing property
> graph object definitions.
Yeah that makes sense to also add some tests here, done in the attached.
> > > The bug only manifests when an event trigger is active, because that is what
> > > calls these functions.
> >
> That covers everything you want to test and its minimal change to the
> test. But I see that the event triggers for all objects are tested in
> event_triggers.sql. So I think the new test should be added to that
> file.
A simpler test has been done in event_trigger.sql instead.
> > > I think that's worth an open item and I'll add one for this issue.
> >
> > This should be an open item, I guess, yes. Could you add one?
One has already been created (I think you need to be logged in to see the
updates).
> Element label, label property are not user visible objects per say, so
> I am not sure whether the code changes are in the right direction. But
> it's also true that we shouldn't get an error in the presence of an
> event trigger. We need to fix that.
Agreed.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Attachments:
[text/x-diff] v2-0001-Fix-DROP-PROPERTY-GRAPH-unsupported-object-class-.patch (10.0K, ../../aen77u5go8P7RJaL@bdtpg/2-v2-0001-Fix-DROP-PROPERTY-GRAPH-unsupported-object-class-.patch)
download | inline diff:
From 029179007d5cde0bcd1cca04cc1698cce39fd366 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Thu, 23 Apr 2026 09:27:39 +0000
Subject: [PATCH v2] Fix DROP PROPERTY GRAPH "unsupported object class" error
getObjectTypeDescription() and getObjectIdentityParts() are missing switch cases
for PropgraphElementLabelRelationId and PropgraphLabelPropertyRelationId, causing
them to hit the default case and error out with "unsupported object class".
During DROP PROPERTY GRAPH, this manifests when an event trigger is active,
because pg_event_trigger_ddl_commands() calls these functions. The same code
paths are also reachable via pg_identify_object() and pg_identify_object_as_address().
This commit adds the missing cases.
Test coverage is added in object_address.sql for these two catalog types via the
zero-OID test that exercises pg_identify_object() and pg_identify_object_as_address().
A test in event_trigger.sql verifies that DROP PROPERTY GRAPH works correctly
when an event trigger is active.
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://postgr.es/m/aej1DkLwhyZWmtxJ@bdtpg
---
src/backend/catalog/objectaddress.c | 93 ++++++++++++++++++++
src/test/regress/expected/event_trigger.out | 17 ++++
src/test/regress/expected/object_address.out | 4 +
src/test/regress/sql/event_trigger.sql | 13 +++
src/test/regress/sql/object_address.sql | 2 +
5 files changed, 129 insertions(+)
62.4% src/backend/catalog/
25.6% src/test/regress/expected/
11.8% src/test/regress/sql/
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index c1862809577..e2d6d8f71f6 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -4901,10 +4901,18 @@ getObjectTypeDescription(const ObjectAddress *object, bool missing_ok)
appendStringInfoString(&buffer, "policy");
break;
+ case PropgraphElementLabelRelationId:
+ appendStringInfoString(&buffer, "property graph element label");
+ break;
+
case PropgraphElementRelationId:
appendStringInfoString(&buffer, "property graph element");
break;
+ case PropgraphLabelPropertyRelationId:
+ appendStringInfoString(&buffer, "property graph label property");
+ break;
+
case PropgraphLabelRelationId:
appendStringInfoString(&buffer, "property graph label");
break;
@@ -6161,6 +6169,49 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
+ case PropgraphElementLabelRelationId:
+ {
+ Relation ellabelDesc;
+ ScanKeyData skey[1];
+ SysScanDesc ellabelscan;
+ HeapTuple tup;
+ Form_pg_propgraph_element_label pgelform;
+ ObjectAddress oa;
+
+ ellabelDesc = table_open(PropgraphElementLabelRelationId, AccessShareLock);
+ ScanKeyInit(&skey[0],
+ Anum_pg_propgraph_element_label_oid,
+ BTEqualStrategyNumber, F_OIDEQ,
+ ObjectIdGetDatum(object->objectId));
+
+ ellabelscan = systable_beginscan(ellabelDesc,
+ PropgraphElementLabelObjectIndexId,
+ true, NULL, 1, skey);
+
+ tup = systable_getnext(ellabelscan);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for element label %u",
+ object->objectId);
+
+ systable_endscan(ellabelscan);
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ pgelform = (Form_pg_propgraph_element_label) GETSTRUCT(tup);
+
+ ObjectAddressSet(oa, PropgraphElementRelationId, pgelform->pgelelid);
+
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+
+ systable_endscan(ellabelscan);
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
case PropgraphElementRelationId:
{
HeapTuple tup;
@@ -6184,6 +6235,48 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
+ case PropgraphLabelPropertyRelationId:
+ {
+ Relation lblpropDesc;
+ ScanKeyData skey[1];
+ SysScanDesc lblpropscan;
+ HeapTuple tup;
+ Form_pg_propgraph_label_property plpform;
+ ObjectAddress oa;
+
+ lblpropDesc = table_open(PropgraphLabelPropertyRelationId,
+ AccessShareLock);
+ ScanKeyInit(&skey[0],
+ Anum_pg_propgraph_label_property_oid,
+ BTEqualStrategyNumber, F_OIDEQ,
+ ObjectIdGetDatum(object->objectId));
+
+ lblpropscan = systable_beginscan(lblpropDesc, PropgraphLabelPropertyObjectIndexId,
+ true, NULL, 1, skey);
+
+ tup = systable_getnext(lblpropscan);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for label property %u",
+ object->objectId);
+
+ systable_endscan(lblpropscan);
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
+ plpform = (Form_pg_propgraph_label_property) GETSTRUCT(tup);
+
+ ObjectAddressSet(oa, PropgraphElementLabelRelationId, plpform->plpellabelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+
+ systable_endscan(lblpropscan);
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
case PropgraphLabelRelationId:
{
HeapTuple tup;
diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out
index 065f586310f..ed8d5df397e 100644
--- a/src/test/regress/expected/event_trigger.out
+++ b/src/test/regress/expected/event_trigger.out
@@ -173,6 +173,23 @@ NOTICE: test_event_trigger: ddl_command_end CREATE USER MAPPING
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
NOTICE: test_event_trigger: ddl_command_end ALTER DEFAULT PRIVILEGES
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE t1x (a int PRIMARY KEY, b text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE t2x (i int PRIMARY KEY, j text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ t1x KEY (a) LABEL l1 PROPERTIES (b AS p1),
+ t2x KEY (i) LABEL l2 PROPERTIES (j AS p1)
+);
+NOTICE: test_event_trigger: ddl_command_end CREATE PROPERTY GRAPH
+DROP PROPERTY GRAPH gx;
+NOTICE: test_event_trigger: ddl_command_end DROP PROPERTY GRAPH
+DROP TABLE t1x, t2x;
+NOTICE: test_event_trigger: ddl_command_end DROP TABLE
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
ERROR: permission denied to change owner of event trigger "regress_event_trigger"
diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out
index 97227d67a54..729c3537f25 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -593,7 +593,9 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_parameter_acl'::regclass, 0, 0), -- no parameter ACL
('pg_policy'::regclass, 0, 0), -- no policy
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
@@ -653,6 +655,8 @@ ORDER BY objects.classid, objects.objid, objects.objsubid;
("(""parameter ACL"",,,)")|("(""parameter ACL"",,)")|NULL
("(""property graph element"",,,)")|("(""property graph element"",,)")|NULL
("(""property graph label"",,,)")|("(""property graph label"",,)")|NULL
+("(""property graph element label"",,,)")|("(""property graph element label"",,)")|NULL
("(""property graph property"",,,)")|("(""property graph property"",,)")|NULL
+("(""property graph label property"",,,)")|("(""property graph label property"",,)")|NULL
-- restore normal output mode
\a\t
diff --git a/src/test/regress/sql/event_trigger.sql b/src/test/regress/sql/event_trigger.sql
index 32e9bb58c5e..271f443378b 100644
--- a/src/test/regress/sql/event_trigger.sql
+++ b/src/test/regress/sql/event_trigger.sql
@@ -143,6 +143,19 @@ create user mapping for regress_evt_user server useless_server;
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE t1x (a int PRIMARY KEY, b text);
+CREATE TABLE t2x (i int PRIMARY KEY, j text);
+
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ t1x KEY (a) LABEL l1 PROPERTIES (b AS p1),
+ t2x KEY (i) LABEL l2 PROPERTIES (j AS p1)
+);
+
+DROP PROPERTY GRAPH gx;
+DROP TABLE t1x, t2x;
+
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
diff --git a/src/test/regress/sql/object_address.sql b/src/test/regress/sql/object_address.sql
index 1bbe9457c1c..620dacf1045 100644
--- a/src/test/regress/sql/object_address.sql
+++ b/src/test/regress/sql/object_address.sql
@@ -282,7 +282,9 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_parameter_acl'::regclass, 0, 0), -- no parameter ACL
('pg_policy'::regclass, 0, 0), -- no policy
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
--
2.34.1
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
@ 2026-04-24 12:07 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
0 siblings, 1 reply; 31+ messages in thread
From: Ashutosh Bapat @ 2026-04-24 12:07 UTC (permalink / raw)
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>
On Thu, Apr 23, 2026 at 4:31 PM Bertrand Drouvot
<bertranddrouvot.pg@gmail.com> wrote:
>
> Hi,
>
> On Thu, Apr 23, 2026 at 12:57:37PM +0530, Ashutosh Bapat wrote:
> > On Thu, Apr 23, 2026 at 12:09 PM Michael Paquier <michael@paquier.xyz> wrote:
> > >
> > > On Wed, Apr 22, 2026 at 04:19:26PM +0000, Bertrand Drouvot wrote:
> > > > Indeed, getObjectTypeDescription() and getObjectIdentityParts() are missing switch
> > > > cases for PropgraphElementLabelRelationId and PropgraphLabelPropertyRelationId,
> > > > causing DROP PROPERTY GRAPH to hit the default case and error out with
> > > > "unsupported object class".
> > >
> > > Hmm. Couldn't these code paths be reached as well with the object
> > > functions like pg_describe_object(), pg_get_object_address(),
> > > pg_identify_object_as_address() or pg_identify_object()? Object
> > > descriptions usually stick within object_address.sql. The new objects
> > > you would want to stick should be covered as well in this test suite,
> > > and the file already has some property graphs in it.
> >
> > +1. See emails around [1] for some discussion about existing property
> > graph object definitions.
>
> Yeah that makes sense to also add some tests here, done in the attached.
>
> > > > The bug only manifests when an event trigger is active, because that is what
> > > > calls these functions.
> > >
> > That covers everything you want to test and its minimal change to the
> > test. But I see that the event triggers for all objects are tested in
> > event_triggers.sql. So I think the new test should be added to that
> > file.
>
> A simpler test has been done in event_trigger.sql instead.
>
> > > > I think that's worth an open item and I'll add one for this issue.
> > >
> > > This should be an open item, I guess, yes. Could you add one?
>
> One has already been created (I think you need to be logged in to see the
> updates).
>
> > Element label, label property are not user visible objects per say, so
> > I am not sure whether the code changes are in the right direction. But
> > it's also true that we shouldn't get an error in the presence of an
> > event trigger. We need to fix that.
>
> Agreed.
I was wrong when I said that element label and label property are not
user visible objects. Sorry.
They are very much user visible and can be operated upon separately.
For example ALTER PROPERTY GRAPH ... ALTER VERTEX TABLE ... ALTER
LABEL ... DROP PROPERTIES ... drop label property objects. Similarly
for ALTER PROPERTY GRAPH ... ALTER VERTEX TABLE ... DROP LABEL ... .
So your code changes are needed. However I think the test cases added
in the patch are not sufficient.
1. Earlier in object_address.sql there are instances of property graph
element, property graph property etc. But I don't see property graph
element label and property graph label property there.
2. In create_graph_table.sql there are tests for pg_describe_object(),
pg_identify_object_as_address() and pg_identify_object() for property
graph property, property graph element and property graph label
objects. But I don't see tests added for the objects covered by the
patch.
For create_graph_table.sql I think what we need to do is add a
RECURSIVE CTE like
WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid,
refobjsubid) AS
(
SELECT classid, objid, objsubid,
refclassid, refobjid, refobjsubid
FROM pg_depend
WHERE refclassid = 'pg_class'::regclass AND
refobjid = 'create_property_graph_tests.g2'::regclass
UNION ALL
SELECT d.classid, d.objid, d.objsubid,
d.refclassid, d.refobjid, d.refobjsubid
FROM pg_depend d
JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid =
dp.objid AND d.refobjsubid = dp.objsubid
)
SELECT pg_describe_object(classid, objid, objsubid) as obj,
pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
FROM deps
ORDER BY 1, 2;
for each of the above functions. This query traverses the dependency
tree thus covering every object that can appear in a property graph.
For 'create_property_graph_tests.g2' the output of the above query
100 rows long which doesn't seem to be worth the code coverage we get.
I guess, we need to choose a property graph with a smaller dependency
tree like gt. I haven't examined whether that graph would cover all
the cases, but it will certainly cover all the objects.
I think the proper description of property graph label property object
is property graph element label property since we are reporting
property of an element through a label. But then that means the
description would be inconsistent with the catalog name and adding
"element" to the catalog name would make it much longer. I am not able
to decide whether to add "element" in the description or not, ATM.
--
Best Wishes,
Ashutosh Bapat
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
@ 2026-04-24 14:18 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
0 siblings, 1 reply; 31+ messages in thread
From: Bertrand Drouvot @ 2026-04-24 14:18 UTC (permalink / raw)
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>
Hi,
On Fri, Apr 24, 2026 at 05:37:56PM +0530, Ashutosh Bapat wrote:
> So your code changes are needed. However I think the test cases added
> in the patch are not sufficient.
> 1. Earlier in object_address.sql there are instances of property graph
> element, property graph property etc. But I don't see property graph
> element label and property graph label property there.
I did not add them because they would not produce an error without the
patch in place. That said, that's probably better to add them for consistency,
done in the attached.
> 2. In create_graph_table.sql there are tests for pg_describe_object(),
> pg_identify_object_as_address() and pg_identify_object() for property
> graph property, property graph element and property graph label
> objects. But I don't see tests added for the objects covered by the
> patch.
>
> For create_graph_table.sql I think what we need to do is add a
> RECURSIVE CTE like
> WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid,
> refobjsubid) AS
> (
> SELECT classid, objid, objsubid,
> refclassid, refobjid, refobjsubid
> FROM pg_depend
> WHERE refclassid = 'pg_class'::regclass AND
> refobjid = 'create_property_graph_tests.g2'::regclass
>
> UNION ALL
>
> SELECT d.classid, d.objid, d.objsubid,
> d.refclassid, d.refobjid, d.refobjsubid
> FROM pg_depend d
> JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid =
> dp.objid AND d.refobjsubid = dp.objsubid
> )
> SELECT pg_describe_object(classid, objid, objsubid) as obj,
> pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
> FROM deps
> ORDER BY 1, 2;
>
> for each of the above functions. This query traverses the dependency
> tree thus covering every object that can appear in a property graph.
> For 'create_property_graph_tests.g2' the output of the above query
> 100 rows long which doesn't seem to be worth the code coverage we get.
> I guess, we need to choose a property graph with a smaller dependency
> tree like gt. I haven't examined whether that graph would cover all
> the cases, but it will certainly cover all the objects.
Yeah, gt is enough to cover all the objects. v3 attached makes use of it and
1/ get rid of the "reference_graph" as it's not needed for the test and 2/
use COLLATE "C" in the order by to be on the safe side of things.
> I think the proper description of property graph label property object
> is property graph element label property since we are reporting
> property of an element through a label. But then that means the
> description would be inconsistent with the catalog name and adding
> "element" to the catalog name would make it much longer. I am not able
> to decide whether to add "element" in the description or not, ATM.
I think it's better to be consistent with the current catalog here to stay
focused on the main purpose of this patch.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Attachments:
[text/x-diff] v3-0001-Fix-DROP-PROPERTY-GRAPH-unsupported-object-class-.patch (26.2K, ../../aet7rawq%2FV07+H1L@bdtpg/2-v3-0001-Fix-DROP-PROPERTY-GRAPH-unsupported-object-class-.patch)
download | inline diff:
From 15326919c14ba751cc7cedc73002854b2ac9442a Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Thu, 23 Apr 2026 09:27:39 +0000
Subject: [PATCH v3] Fix DROP PROPERTY GRAPH "unsupported object class" error
getObjectTypeDescription() and getObjectIdentityParts() are missing switch cases
for PropgraphElementLabelRelationId and PropgraphLabelPropertyRelationId, causing
them to hit the default case and error out with "unsupported object class".
During DROP PROPERTY GRAPH, this manifests when an event trigger is active,
because pg_event_trigger_ddl_commands() calls these functions. The same code
paths are also reachable via pg_identify_object() and pg_identify_object_as_address().
This commit adds the missing cases.
Test coverage is added in object_address.sql for these two catalog types and
in create_property_graph.sql covering all property graph object types.
A test in event_trigger.sql verifies that DROP PROPERTY GRAPH works correctly
when an event trigger is active.
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://postgr.es/m/aej1DkLwhyZWmtxJ@bdtpg
---
src/backend/catalog/objectaddress.c | 93 +++++++++++++++++++
.../expected/create_property_graph.out | 78 ++++++++++++++++
src/test/regress/expected/event_trigger.out | 17 ++++
src/test/regress/expected/object_address.out | 10 +-
.../regress/sql/create_property_graph.sql | 23 +++++
src/test/regress/sql/event_trigger.sql | 13 +++
src/test/regress/sql/object_address.sql | 6 +-
7 files changed, 238 insertions(+), 2 deletions(-)
14.7% src/backend/catalog/
75.5% src/test/regress/expected/
9.7% src/test/regress/sql/
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index c1862809577..e2d6d8f71f6 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -4901,10 +4901,18 @@ getObjectTypeDescription(const ObjectAddress *object, bool missing_ok)
appendStringInfoString(&buffer, "policy");
break;
+ case PropgraphElementLabelRelationId:
+ appendStringInfoString(&buffer, "property graph element label");
+ break;
+
case PropgraphElementRelationId:
appendStringInfoString(&buffer, "property graph element");
break;
+ case PropgraphLabelPropertyRelationId:
+ appendStringInfoString(&buffer, "property graph label property");
+ break;
+
case PropgraphLabelRelationId:
appendStringInfoString(&buffer, "property graph label");
break;
@@ -6161,6 +6169,49 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
+ case PropgraphElementLabelRelationId:
+ {
+ Relation ellabelDesc;
+ ScanKeyData skey[1];
+ SysScanDesc ellabelscan;
+ HeapTuple tup;
+ Form_pg_propgraph_element_label pgelform;
+ ObjectAddress oa;
+
+ ellabelDesc = table_open(PropgraphElementLabelRelationId, AccessShareLock);
+ ScanKeyInit(&skey[0],
+ Anum_pg_propgraph_element_label_oid,
+ BTEqualStrategyNumber, F_OIDEQ,
+ ObjectIdGetDatum(object->objectId));
+
+ ellabelscan = systable_beginscan(ellabelDesc,
+ PropgraphElementLabelObjectIndexId,
+ true, NULL, 1, skey);
+
+ tup = systable_getnext(ellabelscan);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for element label %u",
+ object->objectId);
+
+ systable_endscan(ellabelscan);
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ pgelform = (Form_pg_propgraph_element_label) GETSTRUCT(tup);
+
+ ObjectAddressSet(oa, PropgraphElementRelationId, pgelform->pgelelid);
+
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+
+ systable_endscan(ellabelscan);
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
case PropgraphElementRelationId:
{
HeapTuple tup;
@@ -6184,6 +6235,48 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
+ case PropgraphLabelPropertyRelationId:
+ {
+ Relation lblpropDesc;
+ ScanKeyData skey[1];
+ SysScanDesc lblpropscan;
+ HeapTuple tup;
+ Form_pg_propgraph_label_property plpform;
+ ObjectAddress oa;
+
+ lblpropDesc = table_open(PropgraphLabelPropertyRelationId,
+ AccessShareLock);
+ ScanKeyInit(&skey[0],
+ Anum_pg_propgraph_label_property_oid,
+ BTEqualStrategyNumber, F_OIDEQ,
+ ObjectIdGetDatum(object->objectId));
+
+ lblpropscan = systable_beginscan(lblpropDesc, PropgraphLabelPropertyObjectIndexId,
+ true, NULL, 1, skey);
+
+ tup = systable_getnext(lblpropscan);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for label property %u",
+ object->objectId);
+
+ systable_endscan(lblpropscan);
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
+ plpform = (Form_pg_propgraph_label_property) GETSTRUCT(tup);
+
+ ObjectAddressSet(oa, PropgraphElementLabelRelationId, plpform->plpellabelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+
+ systable_endscan(lblpropscan);
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
case PropgraphLabelRelationId:
{
HeapTuple tup;
diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out
index bc9a596ec89..eb9e17fb727 100644
--- a/src/test/regress/expected/create_property_graph.out
+++ b/src/test/regress/expected/create_property_graph.out
@@ -752,6 +752,84 @@ SELECT (pg_identify_object(classid, objid, objsubid)).*
type | create_property_graph_tests | g2 | create_property_graph_tests.g2
(21 rows)
+-- test object address functions with recursive dependency walk
+-- covers all property graph object types including indirect dependents
+SELECT *
+FROM (
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ )
+ SELECT pg_describe_object(classid, objid, objsubid) as obj,
+ pg_identify_object(classid, objid, objsubid) as ident,
+ pg_identify_object_as_address(classid, objid, objsubid) as addr
+ FROM deps
+) s
+ORDER BY obj COLLATE "C", ident::text COLLATE "C";
+ obj | ident | addr
+----------------------------------------------------------+----------------------------------------------------------------------------+----------------------------------------------------------------------------
+ edge e of property graph gt | ("property graph element",,,"e of create_property_graph_tests.gt") | ("property graph element","{create_property_graph_tests,gt,e}",{})
+ edge e of property graph gt | ("property graph element",,,"e of create_property_graph_tests.gt") | ("property graph element","{create_property_graph_tests,gt,e}",{})
+ edge e of property graph gt | ("property graph element",,,"e of create_property_graph_tests.gt") | ("property graph element","{create_property_graph_tests,gt,e}",{})
+ label e of edge e of property graph gt | ("property graph element label",,,"e of create_property_graph_tests.gt") | ("property graph element label","{create_property_graph_tests,gt,e}",{})
+ label e of edge e of property graph gt | ("property graph element label",,,"e of create_property_graph_tests.gt") | ("property graph element label","{create_property_graph_tests,gt,e}",{})
+ label e of edge e of property graph gt | ("property graph element label",,,"e of create_property_graph_tests.gt") | ("property graph element label","{create_property_graph_tests,gt,e}",{})
+ label e of edge e of property graph gt | ("property graph element label",,,"e of create_property_graph_tests.gt") | ("property graph element label","{create_property_graph_tests,gt,e}",{})
+ label e of property graph gt | ("property graph label",,,"e of create_property_graph_tests.gt") | ("property graph label","{create_property_graph_tests,gt,e}",{})
+ label v1 of property graph gt | ("property graph label",,,"v1 of create_property_graph_tests.gt") | ("property graph label","{create_property_graph_tests,gt,v1}",{})
+ label v1 of vertex v1 of property graph gt | ("property graph element label",,,"v1 of create_property_graph_tests.gt") | ("property graph element label","{create_property_graph_tests,gt,v1}",{})
+ label v1 of vertex v1 of property graph gt | ("property graph element label",,,"v1 of create_property_graph_tests.gt") | ("property graph element label","{create_property_graph_tests,gt,v1}",{})
+ label v2 of property graph gt | ("property graph label",,,"v2 of create_property_graph_tests.gt") | ("property graph label","{create_property_graph_tests,gt,v2}",{})
+ label v2 of vertex v2 of property graph gt | ("property graph element label",,,"v2 of create_property_graph_tests.gt") | ("property graph element label","{create_property_graph_tests,gt,v2}",{})
+ label v2 of vertex v2 of property graph gt | ("property graph element label",,,"v2 of create_property_graph_tests.gt") | ("property graph element label","{create_property_graph_tests,gt,v2}",{})
+ property a of label v1 of vertex v1 of property graph gt | ("property graph label property",,,"v1 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v1}",{})
+ property a of label v1 of vertex v1 of property graph gt | ("property graph label property",,,"v1 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v1}",{})
+ property a of label v1 of vertex v1 of property graph gt | ("property graph label property",,,"v1 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v1}",{})
+ property a of property graph gt | ("property graph property",,,"a of create_property_graph_tests.gt") | ("property graph property","{create_property_graph_tests,gt,a}",{})
+ property b of label v1 of vertex v1 of property graph gt | ("property graph label property",,,"v1 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v1}",{})
+ property b of label v1 of vertex v1 of property graph gt | ("property graph label property",,,"v1 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v1}",{})
+ property b of label v1 of vertex v1 of property graph gt | ("property graph label property",,,"v1 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v1}",{})
+ property b of property graph gt | ("property graph property",,,"b of create_property_graph_tests.gt") | ("property graph property","{create_property_graph_tests,gt,b}",{})
+ property c of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property c of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property c of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property c of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property c of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property c of property graph gt | ("property graph property",,,"c of create_property_graph_tests.gt") | ("property graph property","{create_property_graph_tests,gt,c}",{})
+ property k1 of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property k1 of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property k1 of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property k1 of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property k1 of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property k1 of property graph gt | ("property graph property",,,"k1 of create_property_graph_tests.gt") | ("property graph property","{create_property_graph_tests,gt,k1}",{})
+ property k2 of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property k2 of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property k2 of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property k2 of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property k2 of label e of edge e of property graph gt | ("property graph label property",,,"e of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,e}",{})
+ property k2 of property graph gt | ("property graph property",,,"k2 of create_property_graph_tests.gt") | ("property graph property","{create_property_graph_tests,gt,k2}",{})
+ property m of label v2 of vertex v2 of property graph gt | ("property graph label property",,,"v2 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v2}",{})
+ property m of label v2 of vertex v2 of property graph gt | ("property graph label property",,,"v2 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v2}",{})
+ property m of label v2 of vertex v2 of property graph gt | ("property graph label property",,,"v2 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v2}",{})
+ property m of property graph gt | ("property graph property",,,"m of create_property_graph_tests.gt") | ("property graph property","{create_property_graph_tests,gt,m}",{})
+ property n of label v2 of vertex v2 of property graph gt | ("property graph label property",,,"v2 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v2}",{})
+ property n of label v2 of vertex v2 of property graph gt | ("property graph label property",,,"v2 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v2}",{})
+ property n of label v2 of vertex v2 of property graph gt | ("property graph label property",,,"v2 of create_property_graph_tests.gt") | ("property graph label property","{create_property_graph_tests,gt,v2}",{})
+ property n of property graph gt | ("property graph property",,,"n of create_property_graph_tests.gt") | ("property graph property","{create_property_graph_tests,gt,n}",{})
+ type gt | (type,create_property_graph_tests,gt,create_property_graph_tests.gt) | (type,{create_property_graph_tests.gt},{})
+ type gt[] | (type,create_property_graph_tests,_gt,create_property_graph_tests.gt[]) | (type,{create_property_graph_tests.gt[]},{})
+ vertex v1 of property graph gt | ("property graph element",,,"v1 of create_property_graph_tests.gt") | ("property graph element","{create_property_graph_tests,gt,v1}",{})
+ vertex v2 of property graph gt | ("property graph element",,,"v2 of create_property_graph_tests.gt") | ("property graph element","{create_property_graph_tests,gt,v2}",{})
+(52 rows)
+
\a\t
SELECT pg_get_propgraphdef('g2'::regclass);
CREATE PROPERTY GRAPH create_property_graph_tests.g2
diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out
index 065f586310f..ed8d5df397e 100644
--- a/src/test/regress/expected/event_trigger.out
+++ b/src/test/regress/expected/event_trigger.out
@@ -173,6 +173,23 @@ NOTICE: test_event_trigger: ddl_command_end CREATE USER MAPPING
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
NOTICE: test_event_trigger: ddl_command_end ALTER DEFAULT PRIVILEGES
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE t1x (a int PRIMARY KEY, b text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE t2x (i int PRIMARY KEY, j text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ t1x KEY (a) LABEL l1 PROPERTIES (b AS p1),
+ t2x KEY (i) LABEL l2 PROPERTIES (j AS p1)
+);
+NOTICE: test_event_trigger: ddl_command_end CREATE PROPERTY GRAPH
+DROP PROPERTY GRAPH gx;
+NOTICE: test_event_trigger: ddl_command_end DROP PROPERTY GRAPH
+DROP TABLE t1x, t2x;
+NOTICE: test_event_trigger: ddl_command_end DROP TABLE
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
ERROR: permission denied to change owner of event trigger "regress_event_trigger"
diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out
index 97227d67a54..5e53f0b092e 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -67,7 +67,9 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph element label'),
+ ('property graph label'), ('property graph label property'),
+ ('property graph property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -84,7 +86,9 @@ WARNING: error for toast table column: unsupported object type "toast table col
WARNING: error for view column: unsupported object type "view column"
WARNING: error for materialized view column: unsupported object type "materialized view column"
WARNING: error for property graph element: unsupported object type "property graph element"
+WARNING: error for property graph element label: unrecognized object type "property graph element label"
WARNING: error for property graph label: unsupported object type "property graph label"
+WARNING: error for property graph label property: unrecognized object type "property graph label property"
WARNING: error for property graph property: unsupported object type "property graph property"
-- miscellaneous other errors
select * from pg_get_object_address('operator of access method', '{btree,integer_ops,1}', '{int4,bool}');
@@ -593,7 +597,9 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_parameter_acl'::regclass, 0, 0), -- no parameter ACL
('pg_policy'::regclass, 0, 0), -- no policy
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
@@ -653,6 +659,8 @@ ORDER BY objects.classid, objects.objid, objects.objsubid;
("(""parameter ACL"",,,)")|("(""parameter ACL"",,)")|NULL
("(""property graph element"",,,)")|("(""property graph element"",,)")|NULL
("(""property graph label"",,,)")|("(""property graph label"",,)")|NULL
+("(""property graph element label"",,,)")|("(""property graph element label"",,)")|NULL
("(""property graph property"",,,)")|("(""property graph property"",,)")|NULL
+("(""property graph label property"",,,)")|("(""property graph label property"",,)")|NULL
-- restore normal output mode
\a\t
diff --git a/src/test/regress/sql/create_property_graph.sql b/src/test/regress/sql/create_property_graph.sql
index 241f93df302..9608dd5c4af 100644
--- a/src/test/regress/sql/create_property_graph.sql
+++ b/src/test/regress/sql/create_property_graph.sql
@@ -298,6 +298,29 @@ SELECT (pg_identify_object(classid, objid, objsubid)).*
refobjid = 'create_property_graph_tests.g2'::regclass
ORDER BY 1, 2, 3, 4;
+-- test object address functions with recursive dependency walk
+-- covers all property graph object types including indirect dependents
+SELECT *
+FROM (
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ )
+ SELECT pg_describe_object(classid, objid, objsubid) as obj,
+ pg_identify_object(classid, objid, objsubid) as ident,
+ pg_identify_object_as_address(classid, objid, objsubid) as addr
+ FROM deps
+) s
+ORDER BY obj COLLATE "C", ident::text COLLATE "C";
+
\a\t
SELECT pg_get_propgraphdef('g2'::regclass);
SELECT pg_get_propgraphdef('g3'::regclass);
diff --git a/src/test/regress/sql/event_trigger.sql b/src/test/regress/sql/event_trigger.sql
index 32e9bb58c5e..271f443378b 100644
--- a/src/test/regress/sql/event_trigger.sql
+++ b/src/test/regress/sql/event_trigger.sql
@@ -143,6 +143,19 @@ create user mapping for regress_evt_user server useless_server;
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE t1x (a int PRIMARY KEY, b text);
+CREATE TABLE t2x (i int PRIMARY KEY, j text);
+
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ t1x KEY (a) LABEL l1 PROPERTIES (b AS p1),
+ t2x KEY (i) LABEL l2 PROPERTIES (j AS p1)
+);
+
+DROP PROPERTY GRAPH gx;
+DROP TABLE t1x, t2x;
+
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
diff --git a/src/test/regress/sql/object_address.sql b/src/test/regress/sql/object_address.sql
index 1bbe9457c1c..27109d421c7 100644
--- a/src/test/regress/sql/object_address.sql
+++ b/src/test/regress/sql/object_address.sql
@@ -67,7 +67,9 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph element label'),
+ ('property graph label'), ('property graph label property'),
+ ('property graph property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -282,7 +284,9 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_parameter_acl'::regclass, 0, 0), -- no parameter ACL
('pg_policy'::regclass, 0, 0), -- no policy
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
--
2.34.1
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
@ 2026-04-29 12:32 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
0 siblings, 1 reply; 31+ messages in thread
From: Ashutosh Bapat @ 2026-04-29 12:32 UTC (permalink / raw)
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>
On Fri, Apr 24, 2026 at 7:48 PM Bertrand Drouvot
<bertranddrouvot.pg@gmail.com> wrote:
>
> > for each of the above functions. This query traverses the dependency
> > tree thus covering every object that can appear in a property graph.
> > For 'create_property_graph_tests.g2' the output of the above query
> > 100 rows long which doesn't seem to be worth the code coverage we get.
> > I guess, we need to choose a property graph with a smaller dependency
> > tree like gt. I haven't examined whether that graph would cover all
> > the cases, but it will certainly cover all the objects.
>
> Yeah, gt is enough to cover all the objects. v3 attached makes use of it and
> 1/ get rid of the "reference_graph" as it's not needed for the test and 2/
> use COLLATE "C" in the order by to be on the safe side of things.
I was thinking of modifying the existing queries as attached.
I think COLLATE "C" is safer, however, it doesn't go well with indexes
in ORDER BY, which make this query easy to write. (see [1]). So far we
haven't seen any buildfarm failures so far with the current ORDER BY.
That makes me think that the query output will be stable even without
COLLATE "C". So keeping it that way. But we can add COLLATE "C" if we
see buildfarm instability.
>
> > I think the proper description of property graph label property object
> > is property graph element label property since we are reporting
> > property of an element through a label. But then that means the
> > description would be inconsistent with the catalog name and adding
> > "element" to the catalog name would make it much longer. I am not able
> > to decide whether to add "element" in the description or not, ATM.
>
> I think it's better to be consistent with the current catalog here to stay
> focused on the main purpose of this patch.
>
Though getObjectTypeDescription() usually prints the description which
is closer to the name of the catalog, that's not always true. E.g
AccessMethodProcedureRelationId maps to "function of access method",
StatisticExtRelationId maps to "statistics object". I think "property
graph element label property" is more appropriate for
PropgraphLabelPropertyRelationId since the property is associated with
the label which in turn is associated with the element. Attached patch
has that change. If Peter feels "property graph label property" is
better, we will use that.
Some more changes as listed below
1. In event_trigger.sql I have modified the names of the tables a bit
so that I can also add an edge element and then test ALTER PROPERTY
GRAPH as well.
2. Used get_catalog_object_by_oid(), which appropriately uses the
cache or table scan in getObjectIdentityParts(). It performs an extra
lookup but I think that's ok, since the latter function is not in a
hot path. I wonder whether get_catalog_object_by_oid() is intended to
be called whenever we want to get the catalog tuple by OID instead of
directly calling sys cache lookup function or catalog scan. At least
the new code you are adding can make use of this function.
3. The cases in getObjectTypeDescription() and
getObjectIdentityParts() are arranged roughly in alphabetical order,
but not exactly. I took some liberty to rearrange the property graph
related cases such that the cases directly dependent on property graph
appear first in the alphabetical order followed by those dependent
through one hop and then those through two hops. That way the code
appears in the order of their dependency and is easy to read. Also
arranged the new entries in objectaddress.sql to follow that order as
per a comment in that file. The way you had arranged it appeared in
alphabetical order if we considered RelationId to be part of the name
not otherwise.
4. getObjectIdentityParts() should be closer to getObjectDescription()
when creating the array of object names and also the identity. For
example getObjectIdentityParts() constructs identity of the property
as "a of create_property_graph_tests.gt" losing the name of the label
whereas getObjectDescription() constructs it as property "a of label
v1 of vertex v1 of property graph gt". Fixed that as well.
[1] https://www.postgresql.org/message-id/2173dc58-6697-1e10-9604-a7c9f2a8bb55@lab.ntt.co.jp
--
Best Wishes,
Ashutosh Bapat
Attachments:
[text/x-patch] v20260429-0001-Handle-element-label-and-element-label-pro.patch (30.8K, ../../CAExHW5vJGHDXyLDAVC3eJF_ykU73AB9CG6HvJ+WtmO+GE4dnzA@mail.gmail.com/2-v20260429-0001-Handle-element-label-and-element-label-pro.patch)
download | inline diff:
From 144c8575ba8c6386e6a738dab7b6c77568598b39 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Thu, 23 Apr 2026 09:27:39 +0000
Subject: [PATCH v20260429 4/4] Handle element label and element label property
objects in object address functions
getObjectTypeDescription() and getObjectIdentityParts() do not handle objects in
pg_propgraph_element_label and pg_propgraph_label_property catalogs. These
functions when called for handling a DDL that affects these objects causes
"unsupported object class" error. An error is reported when these functions are
called when pg_identify_object() and pg_identify_object_as_address() are invoked
with objects from the said catalogs.
The objects in these catalogs do not have a (user given) name but they can be
manipulated invdividually through ALTER PROPERTY GRAPH sub-commands. Hence they
need to be accessible to the event triggers. Handle these catalogs in the
respective functions.
Reported-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://postgr.es/m/aej1DkLwhyZWmtxJ@bdtpg
---
src/backend/catalog/objectaddress.c | 83 ++++++++
.../expected/create_property_graph.out | 198 ++++++++++--------
src/test/regress/expected/event_trigger.out | 22 ++
src/test/regress/expected/object_address.out | 9 +-
.../regress/sql/create_property_graph.sql | 31 ++-
src/test/regress/sql/event_trigger.sql | 15 ++
src/test/regress/sql/object_address.sql | 5 +-
7 files changed, 267 insertions(+), 96 deletions(-)
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index c1862809577..7451c5b16b2 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -4913,6 +4913,14 @@ getObjectTypeDescription(const ObjectAddress *object, bool missing_ok)
appendStringInfoString(&buffer, "property graph property");
break;
+ case PropgraphElementLabelRelationId:
+ appendStringInfoString(&buffer, "property graph element label");
+ break;
+
+ case PropgraphLabelPropertyRelationId:
+ appendStringInfoString(&buffer, "property graph element label property");
+ break;
+
case PublicationRelationId:
appendStringInfoString(&buffer, "publication");
break;
@@ -6228,6 +6236,81 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
+ case PropgraphElementLabelRelationId:
+ {
+ Relation ellabelDesc;
+ HeapTuple tup;
+ Form_pg_propgraph_element_label pgelform;
+ ObjectAddress oa;
+ char *labelname;
+
+ ellabelDesc = table_open(PropgraphElementLabelRelationId, AccessShareLock);
+ tup = get_catalog_object_by_oid(ellabelDesc,
+ Anum_pg_propgraph_element_label_oid,
+ object->objectId);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for element label %u",
+ object->objectId);
+
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ pgelform = (Form_pg_propgraph_element_label) GETSTRUCT(tup);
+
+ labelname = get_propgraph_label_name(pgelform->pgellabelid);
+ appendStringInfo(&buffer, _("%s of "), quote_identifier(labelname));
+ ObjectAddressSet(oa, PropgraphElementRelationId, pgelform->pgelelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+ /* labelname is already pstrdup'ed. */
+ if (objname)
+ *objname = lappend(*objname, labelname);
+
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ case PropgraphLabelPropertyRelationId:
+ {
+ Relation lblpropDesc;
+ HeapTuple tup;
+ Form_pg_propgraph_label_property plpform;
+ ObjectAddress oa;
+ char *propname;
+
+ lblpropDesc = table_open(PropgraphLabelPropertyRelationId,
+ AccessShareLock);
+ tup = get_catalog_object_by_oid(lblpropDesc,
+ Anum_pg_propgraph_label_property_oid,
+ object->objectId);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for label property %u",
+ object->objectId);
+
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
+ plpform = (Form_pg_propgraph_label_property) GETSTRUCT(tup);
+
+ propname = get_propgraph_property_name(plpform->plppropid);
+ appendStringInfo(&buffer, _("%s of "), quote_identifier(propname));
+ ObjectAddressSet(oa, PropgraphElementLabelRelationId, plpform->plpellabelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+ /* propname is already pstrdup'ed. */
+ if (objname)
+ *objname = lappend(*objname, propname);
+
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
case PublicationRelationId:
{
char *pubname;
diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out
index 7c3f25a3e0d..d3c2758257f 100644
--- a/src/test/regress/expected/create_property_graph.out
+++ b/src/test/regress/expected/create_property_graph.out
@@ -669,96 +669,128 @@ SELECT * FROM information_schema.pg_property_graph_privileges WHERE grantee LIKE
(2 rows)
-- test object address functions
+CREATE TEMPORARY VIEW deps_tree AS
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass AND
+ -- eliminate this view, which is not a real dependency, from the result
+ classid <> 'pg_rewrite'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ ) SELECT DISTINCT * FROM deps;
SELECT pg_describe_object(classid, objid, objsubid) as obj,
- pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2;
- obj | reference_graph
----------------------------------+-------------------
- edge e1 of property graph g2 | property graph g2
- edge e2 of property graph g2 | property graph g2
- label e1 of property graph g2 | property graph g2
- label e2 of property graph g2 | property graph g2
- label t1 of property graph g2 | property graph g2
- label t2 of property graph g2 | property graph g2
- label t3l1 of property graph g2 | property graph g2
- label t3l2 of property graph g2 | property graph g2
- property a of property graph g2 | property graph g2
- property b of property graph g2 | property graph g2
- property i of property graph g2 | property graph g2
- property j of property graph g2 | property graph g2
- property k of property graph g2 | property graph g2
- property t of property graph g2 | property graph g2
- property x of property graph g2 | property graph g2
- property y of property graph g2 | property graph g2
- property z of property graph g2 | property graph g2
- type g2 | property graph g2
- vertex t1 of property graph g2 | property graph g2
- vertex t2 of property graph g2 | property graph g2
- vertex t3 of property graph g2 | property graph g2
-(21 rows)
+ pg_describe_object(refclassid, refobjid, refobjsubid) as refobj
+ FROM deps_tree ORDER BY 1, 2;
+ obj | refobj
+----------------------------------------------------------+--------------------------------------------
+ edge e of property graph gt | property graph gt
+ edge e of property graph gt | vertex v1 of property graph gt
+ edge e of property graph gt | vertex v2 of property graph gt
+ label e of edge e of property graph gt | edge e of property graph gt
+ label e of edge e of property graph gt | label e of property graph gt
+ label e of property graph gt | property graph gt
+ label v1 of property graph gt | property graph gt
+ label v1 of vertex v1 of property graph gt | label v1 of property graph gt
+ label v1 of vertex v1 of property graph gt | vertex v1 of property graph gt
+ label v2 of property graph gt | property graph gt
+ label v2 of vertex v2 of property graph gt | label v2 of property graph gt
+ label v2 of vertex v2 of property graph gt | vertex v2 of property graph gt
+ property a of label v1 of vertex v1 of property graph gt | label v1 of vertex v1 of property graph gt
+ property a of label v1 of vertex v1 of property graph gt | property a of property graph gt
+ property a of property graph gt | property graph gt
+ property b of label v1 of vertex v1 of property graph gt | label v1 of vertex v1 of property graph gt
+ property b of label v1 of vertex v1 of property graph gt | property b of property graph gt
+ property b of property graph gt | property graph gt
+ property c of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property c of label e of edge e of property graph gt | property c of property graph gt
+ property c of property graph gt | property graph gt
+ property k1 of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property k1 of label e of edge e of property graph gt | property k1 of property graph gt
+ property k1 of property graph gt | property graph gt
+ property k2 of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property k2 of label e of edge e of property graph gt | property k2 of property graph gt
+ property k2 of property graph gt | property graph gt
+ property m of label v2 of vertex v2 of property graph gt | label v2 of vertex v2 of property graph gt
+ property m of label v2 of vertex v2 of property graph gt | property m of property graph gt
+ property m of property graph gt | property graph gt
+ property n of label v2 of vertex v2 of property graph gt | label v2 of vertex v2 of property graph gt
+ property n of label v2 of vertex v2 of property graph gt | property n of property graph gt
+ property n of property graph gt | property graph gt
+ type gt | property graph gt
+ type gt[] | type gt
+ vertex v1 of property graph gt | property graph gt
+ vertex v2 of property graph gt | property graph gt
+(37 rows)
SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3;
- type | object_names | object_args
--------------------------+---------------------------------------+-------------
- property graph element | {create_property_graph_tests,g2,e1} | {}
- property graph element | {create_property_graph_tests,g2,e2} | {}
- property graph element | {create_property_graph_tests,g2,t1} | {}
- property graph element | {create_property_graph_tests,g2,t2} | {}
- property graph element | {create_property_graph_tests,g2,t3} | {}
- property graph label | {create_property_graph_tests,g2,e1} | {}
- property graph label | {create_property_graph_tests,g2,e2} | {}
- property graph label | {create_property_graph_tests,g2,t1} | {}
- property graph label | {create_property_graph_tests,g2,t2} | {}
- property graph label | {create_property_graph_tests,g2,t3l1} | {}
- property graph label | {create_property_graph_tests,g2,t3l2} | {}
- property graph property | {create_property_graph_tests,g2,a} | {}
- property graph property | {create_property_graph_tests,g2,b} | {}
- property graph property | {create_property_graph_tests,g2,i} | {}
- property graph property | {create_property_graph_tests,g2,j} | {}
- property graph property | {create_property_graph_tests,g2,k} | {}
- property graph property | {create_property_graph_tests,g2,t} | {}
- property graph property | {create_property_graph_tests,g2,x} | {}
- property graph property | {create_property_graph_tests,g2,y} | {}
- property graph property | {create_property_graph_tests,g2,z} | {}
- type | {create_property_graph_tests.g2} | {}
-(21 rows)
+ type | object_names | object_args
+---------------------------------------+------------------------------------------+-------------
+ property graph element | {create_property_graph_tests,gt,e} | {}
+ property graph element | {create_property_graph_tests,gt,v1} | {}
+ property graph element | {create_property_graph_tests,gt,v2} | {}
+ property graph element label | {create_property_graph_tests,gt,e,e} | {}
+ property graph element label | {create_property_graph_tests,gt,v1,v1} | {}
+ property graph element label | {create_property_graph_tests,gt,v2,v2} | {}
+ property graph element label property | {create_property_graph_tests,gt,e,e,c} | {}
+ property graph element label property | {create_property_graph_tests,gt,e,e,k1} | {}
+ property graph element label property | {create_property_graph_tests,gt,e,e,k2} | {}
+ property graph element label property | {create_property_graph_tests,gt,v1,v1,a} | {}
+ property graph element label property | {create_property_graph_tests,gt,v1,v1,b} | {}
+ property graph element label property | {create_property_graph_tests,gt,v2,v2,m} | {}
+ property graph element label property | {create_property_graph_tests,gt,v2,v2,n} | {}
+ property graph label | {create_property_graph_tests,gt,e} | {}
+ property graph label | {create_property_graph_tests,gt,v1} | {}
+ property graph label | {create_property_graph_tests,gt,v2} | {}
+ property graph property | {create_property_graph_tests,gt,a} | {}
+ property graph property | {create_property_graph_tests,gt,b} | {}
+ property graph property | {create_property_graph_tests,gt,c} | {}
+ property graph property | {create_property_graph_tests,gt,k1} | {}
+ property graph property | {create_property_graph_tests,gt,k2} | {}
+ property graph property | {create_property_graph_tests,gt,m} | {}
+ property graph property | {create_property_graph_tests,gt,n} | {}
+ type | {create_property_graph_tests.gt} | {}
+ type | {create_property_graph_tests.gt[]} | {}
+(25 rows)
SELECT (pg_identify_object(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3, 4;
- type | schema | name | identity
--------------------------+-----------------------------+------+----------------------------------------
- property graph element | | | e1 of create_property_graph_tests.g2
- property graph element | | | e2 of create_property_graph_tests.g2
- property graph element | | | t1 of create_property_graph_tests.g2
- property graph element | | | t2 of create_property_graph_tests.g2
- property graph element | | | t3 of create_property_graph_tests.g2
- property graph label | | | e1 of create_property_graph_tests.g2
- property graph label | | | e2 of create_property_graph_tests.g2
- property graph label | | | t1 of create_property_graph_tests.g2
- property graph label | | | t2 of create_property_graph_tests.g2
- property graph label | | | t3l1 of create_property_graph_tests.g2
- property graph label | | | t3l2 of create_property_graph_tests.g2
- property graph property | | | a of create_property_graph_tests.g2
- property graph property | | | b of create_property_graph_tests.g2
- property graph property | | | i of create_property_graph_tests.g2
- property graph property | | | j of create_property_graph_tests.g2
- property graph property | | | k of create_property_graph_tests.g2
- property graph property | | | t of create_property_graph_tests.g2
- property graph property | | | x of create_property_graph_tests.g2
- property graph property | | | y of create_property_graph_tests.g2
- property graph property | | | z of create_property_graph_tests.g2
- type | create_property_graph_tests | g2 | create_property_graph_tests.g2
-(21 rows)
+ type | schema | name | identity
+---------------------------------------+-----------------------------+------+-------------------------------------------------
+ property graph element | | | e of create_property_graph_tests.gt
+ property graph element | | | v1 of create_property_graph_tests.gt
+ property graph element | | | v2 of create_property_graph_tests.gt
+ property graph element label | | | e of e of create_property_graph_tests.gt
+ property graph element label | | | v1 of v1 of create_property_graph_tests.gt
+ property graph element label | | | v2 of v2 of create_property_graph_tests.gt
+ property graph element label property | | | a of v1 of v1 of create_property_graph_tests.gt
+ property graph element label property | | | b of v1 of v1 of create_property_graph_tests.gt
+ property graph element label property | | | c of e of e of create_property_graph_tests.gt
+ property graph element label property | | | k1 of e of e of create_property_graph_tests.gt
+ property graph element label property | | | k2 of e of e of create_property_graph_tests.gt
+ property graph element label property | | | m of v2 of v2 of create_property_graph_tests.gt
+ property graph element label property | | | n of v2 of v2 of create_property_graph_tests.gt
+ property graph label | | | e of create_property_graph_tests.gt
+ property graph label | | | v1 of create_property_graph_tests.gt
+ property graph label | | | v2 of create_property_graph_tests.gt
+ property graph property | | | a of create_property_graph_tests.gt
+ property graph property | | | b of create_property_graph_tests.gt
+ property graph property | | | c of create_property_graph_tests.gt
+ property graph property | | | k1 of create_property_graph_tests.gt
+ property graph property | | | k2 of create_property_graph_tests.gt
+ property graph property | | | m of create_property_graph_tests.gt
+ property graph property | | | n of create_property_graph_tests.gt
+ type | create_property_graph_tests | _gt | create_property_graph_tests.gt[]
+ type | create_property_graph_tests | gt | create_property_graph_tests.gt
+(25 rows)
\a\t
SELECT pg_get_propgraphdef('g2'::regclass);
diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out
index 065f586310f..86ae50ce531 100644
--- a/src/test/regress/expected/event_trigger.out
+++ b/src/test/regress/expected/event_trigger.out
@@ -173,6 +173,28 @@ NOTICE: test_event_trigger: ddl_command_end CREATE USER MAPPING
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
NOTICE: test_event_trigger: ddl_command_end ALTER DEFAULT PRIVILEGES
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE tv1 (a int PRIMARY KEY, b text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE tv2 (i int PRIMARY KEY, j text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE te1 (p int PRIMARY KEY, a int REFERENCES tv1(a), b int REFERENCES tv2(i), q text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ tv1 LABEL l1 PROPERTIES (b AS p1),
+ tv2 LABEL l2 PROPERTIES (j AS p1))
+ EDGE TABLES (te1 SOURCE tv1 DESTINATION tv2 LABEL e1 PROPERTIES (q as p1));
+NOTICE: test_event_trigger: ddl_command_end CREATE PROPERTY GRAPH
+ALTER PROPERTY GRAPH gx ALTER EDGE TABLE te1 ALTER LABEL e1 DROP PROPERTIES (p1);
+NOTICE: test_event_trigger: ddl_command_end ALTER PROPERTY GRAPH
+DROP PROPERTY GRAPH gx;
+NOTICE: test_event_trigger: ddl_command_end DROP PROPERTY GRAPH
+DROP TABLE tv1, tv2, te1;
+NOTICE: test_event_trigger: ddl_command_end DROP TABLE
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
ERROR: permission denied to change owner of event trigger "regress_event_trigger"
diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out
index 97227d67a54..9f2d08398b0 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -67,7 +67,8 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph label'), ('property graph property'),
+ ('property graph element label'), ('property graph element label property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -86,6 +87,8 @@ WARNING: error for materialized view column: unsupported object type "materiali
WARNING: error for property graph element: unsupported object type "property graph element"
WARNING: error for property graph label: unsupported object type "property graph label"
WARNING: error for property graph property: unsupported object type "property graph property"
+WARNING: error for property graph element label: unrecognized object type "property graph element label"
+WARNING: error for property graph element label property: unrecognized object type "property graph element label property"
-- miscellaneous other errors
select * from pg_get_object_address('operator of access method', '{btree,integer_ops,1}', '{int4,bool}');
ERROR: operator 1 (int4, bool) of operator family integer_ops for access method btree does not exist
@@ -595,6 +598,8 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
('pg_publication_rel'::regclass, 0, 0), -- no publication relation
@@ -653,6 +658,8 @@ ORDER BY objects.classid, objects.objid, objects.objsubid;
("(""parameter ACL"",,,)")|("(""parameter ACL"",,)")|NULL
("(""property graph element"",,,)")|("(""property graph element"",,)")|NULL
("(""property graph label"",,,)")|("(""property graph label"",,)")|NULL
+("(""property graph element label"",,,)")|("(""property graph element label"",,)")|NULL
("(""property graph property"",,,)")|("(""property graph property"",,)")|NULL
+("(""property graph element label property"",,,)")|("(""property graph element label property"",,)")|NULL
-- restore normal output mode
\a\t
diff --git a/src/test/regress/sql/create_property_graph.sql b/src/test/regress/sql/create_property_graph.sql
index 191412a6a33..e8b3b3ff94c 100644
--- a/src/test/regress/sql/create_property_graph.sql
+++ b/src/test/regress/sql/create_property_graph.sql
@@ -286,21 +286,30 @@ SELECT * FROM information_schema.pg_property_data_types ORDER BY property_graph_
SELECT * FROM information_schema.pg_property_graph_privileges WHERE grantee LIKE 'regress%' ORDER BY property_graph_name, grantor, grantee, privilege_type;
-- test object address functions
+CREATE TEMPORARY VIEW deps_tree AS
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass AND
+ -- eliminate this view, which is not a real dependency, from the result
+ classid <> 'pg_rewrite'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ ) SELECT DISTINCT * FROM deps;
+
SELECT pg_describe_object(classid, objid, objsubid) as obj,
- pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2;
+ pg_describe_object(refclassid, refobjid, refobjsubid) as refobj
+ FROM deps_tree ORDER BY 1, 2;
SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3;
SELECT (pg_identify_object(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3, 4;
\a\t
diff --git a/src/test/regress/sql/event_trigger.sql b/src/test/regress/sql/event_trigger.sql
index 32e9bb58c5e..d0e6ba295fe 100644
--- a/src/test/regress/sql/event_trigger.sql
+++ b/src/test/regress/sql/event_trigger.sql
@@ -143,6 +143,21 @@ create user mapping for regress_evt_user server useless_server;
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE tv1 (a int PRIMARY KEY, b text);
+CREATE TABLE tv2 (i int PRIMARY KEY, j text);
+CREATE TABLE te1 (p int PRIMARY KEY, a int REFERENCES tv1(a), b int REFERENCES tv2(i), q text);
+
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ tv1 LABEL l1 PROPERTIES (b AS p1),
+ tv2 LABEL l2 PROPERTIES (j AS p1))
+ EDGE TABLES (te1 SOURCE tv1 DESTINATION tv2 LABEL e1 PROPERTIES (q as p1));
+
+ALTER PROPERTY GRAPH gx ALTER EDGE TABLE te1 ALTER LABEL e1 DROP PROPERTIES (p1);
+DROP PROPERTY GRAPH gx;
+DROP TABLE tv1, tv2, te1;
+
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
diff --git a/src/test/regress/sql/object_address.sql b/src/test/regress/sql/object_address.sql
index 1bbe9457c1c..e987bd3542f 100644
--- a/src/test/regress/sql/object_address.sql
+++ b/src/test/regress/sql/object_address.sql
@@ -67,7 +67,8 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph label'), ('property graph property'),
+ ('property graph element label'), ('property graph element label property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -284,6 +285,8 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
('pg_publication_rel'::regclass, 0, 0), -- no publication relation
--
2.34.1
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
@ 2026-04-30 11:26 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
0 siblings, 1 reply; 31+ messages in thread
From: Bertrand Drouvot @ 2026-04-30 11:26 UTC (permalink / raw)
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>
Hi,
On Wed, Apr 29, 2026 at 06:02:57PM +0530, Ashutosh Bapat wrote:
> On Fri, Apr 24, 2026 at 7:48 PM Bertrand Drouvot
> <bertranddrouvot.pg@gmail.com> wrote:
> >
>
> > > for each of the above functions. This query traverses the dependency
> > > tree thus covering every object that can appear in a property graph.
> > > For 'create_property_graph_tests.g2' the output of the above query
> > > 100 rows long which doesn't seem to be worth the code coverage we get.
> > > I guess, we need to choose a property graph with a smaller dependency
> > > tree like gt. I haven't examined whether that graph would cover all
> > > the cases, but it will certainly cover all the objects.
> >
> > 1/ get rid of the "reference_graph" as it's not needed for the test and 2/
> > use COLLATE "C" in the order by to be on the safe side of things.
>
> I was thinking of modifying the existing queries as attached.
Works for me.
>
> I think COLLATE "C" is safer, however, it doesn't go well with indexes
> in ORDER BY, which make this query easy to write. (see [1]). So far we
> haven't seen any buildfarm failures so far with the current ORDER BY.
> That makes me think that the query output will be stable even without
> COLLATE "C". So keeping it that way. But we can add COLLATE "C" if we
> see buildfarm instability.
I can see the the instability locally with en_US.UTF-8 (gt before _gt) and I
can see that, for example sifaka, has en_US.UTF-8 in locales. So, modifying the
impacted query a bit to add COLLATE "C" in the attached.
> 2. Used get_catalog_object_by_oid(), which appropriately uses the
> cache or table scan in getObjectIdentityParts(). It performs an extra
> lookup but I think that's ok, since the latter function is not in a
> hot path. I wonder whether get_catalog_object_by_oid() is intended to
> be called whenever we want to get the catalog tuple by OID instead of
> directly calling sys cache lookup function or catalog scan. At least
> the new code you are adding can make use of this function.
v3 was using the syscan to be consistent with what getObjectDescription() was
doing. That makes sense to me to be consistent, so in passing v5 makes use of
get_catalog_object_by_oid() in getObjectDescription() too.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Attachments:
[text/x-diff] v5-0001-Handle-element-label-and-element-label-property-o.patch (34.0K, ../../afM8dgqqxsxqmnY7@bdtpg/2-v5-0001-Handle-element-label-and-element-label-property-o.patch)
download | inline diff:
From 51f9d27113edaf93a2869fa252a91c6b95b415fa Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Thu, 23 Apr 2026 09:27:39 +0000
Subject: [PATCH v5] Handle element label and element label property objects in
object address functions
getObjectTypeDescription() and getObjectIdentityParts() do not handle objects in
pg_propgraph_element_label and pg_propgraph_label_property catalogs. These
functions when called for handling a DDL that affects these objects causes
"unsupported object class" error. An error is reported when these functions are
called when pg_identify_object() and pg_identify_object_as_address() are invoked
with objects from the said catalogs.
The objects in these catalogs do not have a (user given) name but they can be
manipulated invdividually through ALTER PROPERTY GRAPH sub-commands. Hence they
need to be accessible to the event triggers. Handle these catalogs in the
respective functions.
In passing, replace manual scans in getObjectDescription() to be consistent with
the ones added in getObjectIdentityParts().
Reported-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://postgr.es/m/aej1DkLwhyZWmtxJ@bdtpg
---
src/backend/catalog/objectaddress.c | 111 ++++++++--
.../expected/create_property_graph.out | 203 ++++++++++--------
src/test/regress/expected/event_trigger.out | 22 ++
src/test/regress/expected/object_address.out | 9 +-
.../regress/sql/create_property_graph.sql | 36 ++--
src/test/regress/sql/event_trigger.sql | 15 ++
src/test/regress/sql/object_address.sql | 5 +-
7 files changed, 279 insertions(+), 122 deletions(-)
15.2% src/backend/catalog/
74.2% src/test/regress/expected/
10.5% src/test/regress/sql/
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index c1862809577..70058522b35 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -4106,26 +4106,19 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
case PropgraphElementLabelRelationId:
{
Relation rel;
- SysScanDesc scan;
- ScanKeyData key[1];
HeapTuple tuple;
Form_pg_propgraph_element_label pgelform;
ObjectAddress oa;
rel = table_open(PropgraphElementLabelRelationId, AccessShareLock);
- ScanKeyInit(&key[0],
- Anum_pg_propgraph_element_label_oid,
- BTEqualStrategyNumber, F_OIDEQ,
- ObjectIdGetDatum(object->objectId));
-
- scan = systable_beginscan(rel, PropgraphElementLabelObjectIndexId, true, NULL, 1, key);
- tuple = systable_getnext(scan);
+ tuple = get_catalog_object_by_oid(rel,
+ Anum_pg_propgraph_element_label_oid,
+ object->objectId);
if (!HeapTupleIsValid(tuple))
{
if (!missing_ok)
elog(ERROR, "could not find tuple for element label %u", object->objectId);
- systable_endscan(scan);
table_close(rel, AccessShareLock);
break;
}
@@ -4136,7 +4129,6 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
ObjectAddressSet(oa, PropgraphElementRelationId, pgelform->pgelelid);
appendStringInfoString(&buffer, getObjectDescription(&oa, false));
- systable_endscan(scan);
table_close(rel, AccessShareLock);
break;
}
@@ -4166,26 +4158,19 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
case PropgraphLabelPropertyRelationId:
{
Relation rel;
- SysScanDesc scan;
- ScanKeyData key[1];
HeapTuple tuple;
Form_pg_propgraph_label_property plpform;
ObjectAddress oa;
rel = table_open(PropgraphLabelPropertyRelationId, AccessShareLock);
- ScanKeyInit(&key[0],
- Anum_pg_propgraph_label_property_oid,
- BTEqualStrategyNumber, F_OIDEQ,
- ObjectIdGetDatum(object->objectId));
-
- scan = systable_beginscan(rel, PropgraphLabelPropertyObjectIndexId, true, NULL, 1, key);
- tuple = systable_getnext(scan);
+ tuple = get_catalog_object_by_oid(rel,
+ Anum_pg_propgraph_label_property_oid,
+ object->objectId);
if (!HeapTupleIsValid(tuple))
{
if (!missing_ok)
elog(ERROR, "could not find tuple for label property %u", object->objectId);
- systable_endscan(scan);
table_close(rel, AccessShareLock);
break;
}
@@ -4196,7 +4181,6 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
ObjectAddressSet(oa, PropgraphElementLabelRelationId, plpform->plpellabelid);
appendStringInfoString(&buffer, getObjectDescription(&oa, false));
- systable_endscan(scan);
table_close(rel, AccessShareLock);
break;
}
@@ -4913,6 +4897,14 @@ getObjectTypeDescription(const ObjectAddress *object, bool missing_ok)
appendStringInfoString(&buffer, "property graph property");
break;
+ case PropgraphElementLabelRelationId:
+ appendStringInfoString(&buffer, "property graph element label");
+ break;
+
+ case PropgraphLabelPropertyRelationId:
+ appendStringInfoString(&buffer, "property graph element label property");
+ break;
+
case PublicationRelationId:
appendStringInfoString(&buffer, "publication");
break;
@@ -6228,6 +6220,81 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
+ case PropgraphElementLabelRelationId:
+ {
+ Relation ellabelDesc;
+ HeapTuple tup;
+ Form_pg_propgraph_element_label pgelform;
+ ObjectAddress oa;
+ char *labelname;
+
+ ellabelDesc = table_open(PropgraphElementLabelRelationId, AccessShareLock);
+ tup = get_catalog_object_by_oid(ellabelDesc,
+ Anum_pg_propgraph_element_label_oid,
+ object->objectId);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for element label %u",
+ object->objectId);
+
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ pgelform = (Form_pg_propgraph_element_label) GETSTRUCT(tup);
+
+ labelname = get_propgraph_label_name(pgelform->pgellabelid);
+ appendStringInfo(&buffer, _("%s of "), quote_identifier(labelname));
+ ObjectAddressSet(oa, PropgraphElementRelationId, pgelform->pgelelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+ /* labelname is already pstrdup'ed. */
+ if (objname)
+ *objname = lappend(*objname, labelname);
+
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ case PropgraphLabelPropertyRelationId:
+ {
+ Relation lblpropDesc;
+ HeapTuple tup;
+ Form_pg_propgraph_label_property plpform;
+ ObjectAddress oa;
+ char *propname;
+
+ lblpropDesc = table_open(PropgraphLabelPropertyRelationId,
+ AccessShareLock);
+ tup = get_catalog_object_by_oid(lblpropDesc,
+ Anum_pg_propgraph_label_property_oid,
+ object->objectId);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for label property %u",
+ object->objectId);
+
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
+ plpform = (Form_pg_propgraph_label_property) GETSTRUCT(tup);
+
+ propname = get_propgraph_property_name(plpform->plppropid);
+ appendStringInfo(&buffer, _("%s of "), quote_identifier(propname));
+ ObjectAddressSet(oa, PropgraphElementLabelRelationId, plpform->plpellabelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+ /* propname is already pstrdup'ed. */
+ if (objname)
+ *objname = lappend(*objname, propname);
+
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
case PublicationRelationId:
{
char *pubname;
diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out
index bc9a596ec89..2e77e4503ae 100644
--- a/src/test/regress/expected/create_property_graph.out
+++ b/src/test/regress/expected/create_property_graph.out
@@ -661,96 +661,129 @@ SELECT * FROM information_schema.pg_property_graph_privileges WHERE grantee LIKE
(2 rows)
-- test object address functions
+CREATE TEMPORARY VIEW deps_tree AS
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass AND
+ -- eliminate this view, which is not a real dependency, from the result
+ classid <> 'pg_rewrite'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ ) SELECT DISTINCT * FROM deps;
SELECT pg_describe_object(classid, objid, objsubid) as obj,
- pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2;
- obj | reference_graph
----------------------------------+-------------------
- edge e1 of property graph g2 | property graph g2
- edge e2 of property graph g2 | property graph g2
- label e1 of property graph g2 | property graph g2
- label e2 of property graph g2 | property graph g2
- label t1 of property graph g2 | property graph g2
- label t2 of property graph g2 | property graph g2
- label t3l1 of property graph g2 | property graph g2
- label t3l2 of property graph g2 | property graph g2
- property a of property graph g2 | property graph g2
- property b of property graph g2 | property graph g2
- property i of property graph g2 | property graph g2
- property j of property graph g2 | property graph g2
- property k of property graph g2 | property graph g2
- property t of property graph g2 | property graph g2
- property x of property graph g2 | property graph g2
- property y of property graph g2 | property graph g2
- property z of property graph g2 | property graph g2
- type g2 | property graph g2
- vertex t1 of property graph g2 | property graph g2
- vertex t2 of property graph g2 | property graph g2
- vertex t3 of property graph g2 | property graph g2
-(21 rows)
+ pg_describe_object(refclassid, refobjid, refobjsubid) as refobj
+ FROM deps_tree ORDER BY 1, 2;
+ obj | refobj
+----------------------------------------------------------+--------------------------------------------
+ edge e of property graph gt | property graph gt
+ edge e of property graph gt | vertex v1 of property graph gt
+ edge e of property graph gt | vertex v2 of property graph gt
+ label e of edge e of property graph gt | edge e of property graph gt
+ label e of edge e of property graph gt | label e of property graph gt
+ label e of property graph gt | property graph gt
+ label v1 of property graph gt | property graph gt
+ label v1 of vertex v1 of property graph gt | label v1 of property graph gt
+ label v1 of vertex v1 of property graph gt | vertex v1 of property graph gt
+ label v2 of property graph gt | property graph gt
+ label v2 of vertex v2 of property graph gt | label v2 of property graph gt
+ label v2 of vertex v2 of property graph gt | vertex v2 of property graph gt
+ property a of label v1 of vertex v1 of property graph gt | label v1 of vertex v1 of property graph gt
+ property a of label v1 of vertex v1 of property graph gt | property a of property graph gt
+ property a of property graph gt | property graph gt
+ property b of label v1 of vertex v1 of property graph gt | label v1 of vertex v1 of property graph gt
+ property b of label v1 of vertex v1 of property graph gt | property b of property graph gt
+ property b of property graph gt | property graph gt
+ property c of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property c of label e of edge e of property graph gt | property c of property graph gt
+ property c of property graph gt | property graph gt
+ property k1 of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property k1 of label e of edge e of property graph gt | property k1 of property graph gt
+ property k1 of property graph gt | property graph gt
+ property k2 of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property k2 of label e of edge e of property graph gt | property k2 of property graph gt
+ property k2 of property graph gt | property graph gt
+ property m of label v2 of vertex v2 of property graph gt | label v2 of vertex v2 of property graph gt
+ property m of label v2 of vertex v2 of property graph gt | property m of property graph gt
+ property m of property graph gt | property graph gt
+ property n of label v2 of vertex v2 of property graph gt | label v2 of vertex v2 of property graph gt
+ property n of label v2 of vertex v2 of property graph gt | property n of property graph gt
+ property n of property graph gt | property graph gt
+ type gt | property graph gt
+ type gt[] | type gt
+ vertex v1 of property graph gt | property graph gt
+ vertex v2 of property graph gt | property graph gt
+(37 rows)
SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3;
- type | object_names | object_args
--------------------------+---------------------------------------+-------------
- property graph element | {create_property_graph_tests,g2,e1} | {}
- property graph element | {create_property_graph_tests,g2,e2} | {}
- property graph element | {create_property_graph_tests,g2,t1} | {}
- property graph element | {create_property_graph_tests,g2,t2} | {}
- property graph element | {create_property_graph_tests,g2,t3} | {}
- property graph label | {create_property_graph_tests,g2,e1} | {}
- property graph label | {create_property_graph_tests,g2,e2} | {}
- property graph label | {create_property_graph_tests,g2,t1} | {}
- property graph label | {create_property_graph_tests,g2,t2} | {}
- property graph label | {create_property_graph_tests,g2,t3l1} | {}
- property graph label | {create_property_graph_tests,g2,t3l2} | {}
- property graph property | {create_property_graph_tests,g2,a} | {}
- property graph property | {create_property_graph_tests,g2,b} | {}
- property graph property | {create_property_graph_tests,g2,i} | {}
- property graph property | {create_property_graph_tests,g2,j} | {}
- property graph property | {create_property_graph_tests,g2,k} | {}
- property graph property | {create_property_graph_tests,g2,t} | {}
- property graph property | {create_property_graph_tests,g2,x} | {}
- property graph property | {create_property_graph_tests,g2,y} | {}
- property graph property | {create_property_graph_tests,g2,z} | {}
- type | {create_property_graph_tests.g2} | {}
-(21 rows)
+ type | object_names | object_args
+---------------------------------------+------------------------------------------+-------------
+ property graph element | {create_property_graph_tests,gt,e} | {}
+ property graph element | {create_property_graph_tests,gt,v1} | {}
+ property graph element | {create_property_graph_tests,gt,v2} | {}
+ property graph element label | {create_property_graph_tests,gt,e,e} | {}
+ property graph element label | {create_property_graph_tests,gt,v1,v1} | {}
+ property graph element label | {create_property_graph_tests,gt,v2,v2} | {}
+ property graph element label property | {create_property_graph_tests,gt,e,e,c} | {}
+ property graph element label property | {create_property_graph_tests,gt,e,e,k1} | {}
+ property graph element label property | {create_property_graph_tests,gt,e,e,k2} | {}
+ property graph element label property | {create_property_graph_tests,gt,v1,v1,a} | {}
+ property graph element label property | {create_property_graph_tests,gt,v1,v1,b} | {}
+ property graph element label property | {create_property_graph_tests,gt,v2,v2,m} | {}
+ property graph element label property | {create_property_graph_tests,gt,v2,v2,n} | {}
+ property graph label | {create_property_graph_tests,gt,e} | {}
+ property graph label | {create_property_graph_tests,gt,v1} | {}
+ property graph label | {create_property_graph_tests,gt,v2} | {}
+ property graph property | {create_property_graph_tests,gt,a} | {}
+ property graph property | {create_property_graph_tests,gt,b} | {}
+ property graph property | {create_property_graph_tests,gt,c} | {}
+ property graph property | {create_property_graph_tests,gt,k1} | {}
+ property graph property | {create_property_graph_tests,gt,k2} | {}
+ property graph property | {create_property_graph_tests,gt,m} | {}
+ property graph property | {create_property_graph_tests,gt,n} | {}
+ type | {create_property_graph_tests.gt} | {}
+ type | {create_property_graph_tests.gt[]} | {}
+(25 rows)
-SELECT (pg_identify_object(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2, 3, 4;
- type | schema | name | identity
--------------------------+-----------------------------+------+----------------------------------------
- property graph element | | | e1 of create_property_graph_tests.g2
- property graph element | | | e2 of create_property_graph_tests.g2
- property graph element | | | t1 of create_property_graph_tests.g2
- property graph element | | | t2 of create_property_graph_tests.g2
- property graph element | | | t3 of create_property_graph_tests.g2
- property graph label | | | e1 of create_property_graph_tests.g2
- property graph label | | | e2 of create_property_graph_tests.g2
- property graph label | | | t1 of create_property_graph_tests.g2
- property graph label | | | t2 of create_property_graph_tests.g2
- property graph label | | | t3l1 of create_property_graph_tests.g2
- property graph label | | | t3l2 of create_property_graph_tests.g2
- property graph property | | | a of create_property_graph_tests.g2
- property graph property | | | b of create_property_graph_tests.g2
- property graph property | | | i of create_property_graph_tests.g2
- property graph property | | | j of create_property_graph_tests.g2
- property graph property | | | k of create_property_graph_tests.g2
- property graph property | | | t of create_property_graph_tests.g2
- property graph property | | | x of create_property_graph_tests.g2
- property graph property | | | y of create_property_graph_tests.g2
- property graph property | | | z of create_property_graph_tests.g2
- type | create_property_graph_tests | g2 | create_property_graph_tests.g2
-(21 rows)
+SELECT *
+ FROM (SELECT (pg_identify_object(classid, objid, objsubid)).*
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)) s
+ ORDER BY type, schema, name COLLATE "C", identity COLLATE "C";
+ type | schema | name | identity
+---------------------------------------+-----------------------------+------+-------------------------------------------------
+ property graph element | | | e of create_property_graph_tests.gt
+ property graph element | | | v1 of create_property_graph_tests.gt
+ property graph element | | | v2 of create_property_graph_tests.gt
+ property graph element label | | | e of e of create_property_graph_tests.gt
+ property graph element label | | | v1 of v1 of create_property_graph_tests.gt
+ property graph element label | | | v2 of v2 of create_property_graph_tests.gt
+ property graph element label property | | | a of v1 of v1 of create_property_graph_tests.gt
+ property graph element label property | | | b of v1 of v1 of create_property_graph_tests.gt
+ property graph element label property | | | c of e of e of create_property_graph_tests.gt
+ property graph element label property | | | k1 of e of e of create_property_graph_tests.gt
+ property graph element label property | | | k2 of e of e of create_property_graph_tests.gt
+ property graph element label property | | | m of v2 of v2 of create_property_graph_tests.gt
+ property graph element label property | | | n of v2 of v2 of create_property_graph_tests.gt
+ property graph label | | | e of create_property_graph_tests.gt
+ property graph label | | | v1 of create_property_graph_tests.gt
+ property graph label | | | v2 of create_property_graph_tests.gt
+ property graph property | | | a of create_property_graph_tests.gt
+ property graph property | | | b of create_property_graph_tests.gt
+ property graph property | | | c of create_property_graph_tests.gt
+ property graph property | | | k1 of create_property_graph_tests.gt
+ property graph property | | | k2 of create_property_graph_tests.gt
+ property graph property | | | m of create_property_graph_tests.gt
+ property graph property | | | n of create_property_graph_tests.gt
+ type | create_property_graph_tests | _gt | create_property_graph_tests.gt[]
+ type | create_property_graph_tests | gt | create_property_graph_tests.gt
+(25 rows)
\a\t
SELECT pg_get_propgraphdef('g2'::regclass);
diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out
index 065f586310f..86ae50ce531 100644
--- a/src/test/regress/expected/event_trigger.out
+++ b/src/test/regress/expected/event_trigger.out
@@ -173,6 +173,28 @@ NOTICE: test_event_trigger: ddl_command_end CREATE USER MAPPING
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
NOTICE: test_event_trigger: ddl_command_end ALTER DEFAULT PRIVILEGES
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE tv1 (a int PRIMARY KEY, b text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE tv2 (i int PRIMARY KEY, j text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE te1 (p int PRIMARY KEY, a int REFERENCES tv1(a), b int REFERENCES tv2(i), q text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ tv1 LABEL l1 PROPERTIES (b AS p1),
+ tv2 LABEL l2 PROPERTIES (j AS p1))
+ EDGE TABLES (te1 SOURCE tv1 DESTINATION tv2 LABEL e1 PROPERTIES (q as p1));
+NOTICE: test_event_trigger: ddl_command_end CREATE PROPERTY GRAPH
+ALTER PROPERTY GRAPH gx ALTER EDGE TABLE te1 ALTER LABEL e1 DROP PROPERTIES (p1);
+NOTICE: test_event_trigger: ddl_command_end ALTER PROPERTY GRAPH
+DROP PROPERTY GRAPH gx;
+NOTICE: test_event_trigger: ddl_command_end DROP PROPERTY GRAPH
+DROP TABLE tv1, tv2, te1;
+NOTICE: test_event_trigger: ddl_command_end DROP TABLE
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
ERROR: permission denied to change owner of event trigger "regress_event_trigger"
diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out
index 97227d67a54..9f2d08398b0 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -67,7 +67,8 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph label'), ('property graph property'),
+ ('property graph element label'), ('property graph element label property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -86,6 +87,8 @@ WARNING: error for materialized view column: unsupported object type "materiali
WARNING: error for property graph element: unsupported object type "property graph element"
WARNING: error for property graph label: unsupported object type "property graph label"
WARNING: error for property graph property: unsupported object type "property graph property"
+WARNING: error for property graph element label: unrecognized object type "property graph element label"
+WARNING: error for property graph element label property: unrecognized object type "property graph element label property"
-- miscellaneous other errors
select * from pg_get_object_address('operator of access method', '{btree,integer_ops,1}', '{int4,bool}');
ERROR: operator 1 (int4, bool) of operator family integer_ops for access method btree does not exist
@@ -595,6 +598,8 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
('pg_publication_rel'::regclass, 0, 0), -- no publication relation
@@ -653,6 +658,8 @@ ORDER BY objects.classid, objects.objid, objects.objsubid;
("(""parameter ACL"",,,)")|("(""parameter ACL"",,)")|NULL
("(""property graph element"",,,)")|("(""property graph element"",,)")|NULL
("(""property graph label"",,,)")|("(""property graph label"",,)")|NULL
+("(""property graph element label"",,,)")|("(""property graph element label"",,)")|NULL
("(""property graph property"",,,)")|("(""property graph property"",,)")|NULL
+("(""property graph element label property"",,,)")|("(""property graph element label property"",,)")|NULL
-- restore normal output mode
\a\t
diff --git a/src/test/regress/sql/create_property_graph.sql b/src/test/regress/sql/create_property_graph.sql
index 241f93df302..de292b3a39c 100644
--- a/src/test/regress/sql/create_property_graph.sql
+++ b/src/test/regress/sql/create_property_graph.sql
@@ -281,22 +281,32 @@ SELECT * FROM information_schema.pg_property_data_types ORDER BY property_graph_
SELECT * FROM information_schema.pg_property_graph_privileges WHERE grantee LIKE 'regress%' ORDER BY property_graph_name, grantor, grantee, privilege_type;
-- test object address functions
+CREATE TEMPORARY VIEW deps_tree AS
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass AND
+ -- eliminate this view, which is not a real dependency, from the result
+ classid <> 'pg_rewrite'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ ) SELECT DISTINCT * FROM deps;
+
SELECT pg_describe_object(classid, objid, objsubid) as obj,
- pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2;
+ pg_describe_object(refclassid, refobjid, refobjsubid) as refobj
+ FROM deps_tree ORDER BY 1, 2;
SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3;
-SELECT (pg_identify_object(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2, 3, 4;
+SELECT *
+ FROM (SELECT (pg_identify_object(classid, objid, objsubid)).*
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)) s
+ ORDER BY type, schema, name COLLATE "C", identity COLLATE "C";
\a\t
SELECT pg_get_propgraphdef('g2'::regclass);
diff --git a/src/test/regress/sql/event_trigger.sql b/src/test/regress/sql/event_trigger.sql
index 32e9bb58c5e..d0e6ba295fe 100644
--- a/src/test/regress/sql/event_trigger.sql
+++ b/src/test/regress/sql/event_trigger.sql
@@ -143,6 +143,21 @@ create user mapping for regress_evt_user server useless_server;
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE tv1 (a int PRIMARY KEY, b text);
+CREATE TABLE tv2 (i int PRIMARY KEY, j text);
+CREATE TABLE te1 (p int PRIMARY KEY, a int REFERENCES tv1(a), b int REFERENCES tv2(i), q text);
+
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ tv1 LABEL l1 PROPERTIES (b AS p1),
+ tv2 LABEL l2 PROPERTIES (j AS p1))
+ EDGE TABLES (te1 SOURCE tv1 DESTINATION tv2 LABEL e1 PROPERTIES (q as p1));
+
+ALTER PROPERTY GRAPH gx ALTER EDGE TABLE te1 ALTER LABEL e1 DROP PROPERTIES (p1);
+DROP PROPERTY GRAPH gx;
+DROP TABLE tv1, tv2, te1;
+
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
diff --git a/src/test/regress/sql/object_address.sql b/src/test/regress/sql/object_address.sql
index 1bbe9457c1c..e987bd3542f 100644
--- a/src/test/regress/sql/object_address.sql
+++ b/src/test/regress/sql/object_address.sql
@@ -67,7 +67,8 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph label'), ('property graph property'),
+ ('property graph element label'), ('property graph element label property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -284,6 +285,8 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
('pg_publication_rel'::regclass, 0, 0), -- no publication relation
--
2.34.1
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
@ 2026-04-30 12:31 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 23:22 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
0 siblings, 2 replies; 31+ messages in thread
From: Ashutosh Bapat @ 2026-04-30 12:31 UTC (permalink / raw)
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>
On Thu, Apr 30, 2026 at 4:56 PM Bertrand Drouvot
<bertranddrouvot.pg@gmail.com> wrote:
>
>
> >
> > I think COLLATE "C" is safer, however, it doesn't go well with indexes
> > in ORDER BY, which make this query easy to write. (see [1]). So far we
> > haven't seen any buildfarm failures so far with the current ORDER BY.
> > That makes me think that the query output will be stable even without
> > COLLATE "C". So keeping it that way. But we can add COLLATE "C" if we
> > see buildfarm instability.
>
> I can see the the instability locally with en_US.UTF-8 (gt before _gt) and I
> can see that, for example sifaka, has en_US.UTF-8 in locales. So, modifying the
> impacted query a bit to add COLLATE "C" in the attached.
>
I did wonder where the instability is coming from the new query - it's
because now we are traversing the entire dependency tree which also
contains array type of reltype. I think we should just eliminate it
from the result just like we are eliminating the rule. There is slight
convenience in keeping the query as is - it need not change even
though the columns returned by the function change and it's more
readable. I also think that we don't need a type defined for a
property graph - it doesn't contain any row as well as the shape of
the result of GRAPH_TABLE depends upon the COLUMNS clause - so that's
not fixed as well. I will start a separate thread for that discussion.
> > 2. Used get_catalog_object_by_oid(), which appropriately uses the
> > cache or table scan in getObjectIdentityParts(). It performs an extra
> > lookup but I think that's ok, since the latter function is not in a
> > hot path. I wonder whether get_catalog_object_by_oid() is intended to
> > be called whenever we want to get the catalog tuple by OID instead of
> > directly calling sys cache lookup function or catalog scan. At least
> > the new code you are adding can make use of this function.
>
> v3 was using the syscan to be consistent with what getObjectDescription() was
> doing. That makes sense to me to be consistent, so in passing v5 makes use of
> get_catalog_object_by_oid() in getObjectDescription() too.
I was planning to start a separate discussion to change all catalog
lookups in those functions to use get_catalog_object_by_oid(), hence
didn't include changes in getObjectDescription(). But I am fine if we
want to do it in this patch just for the property graph related nodes.
--
Best Wishes,
Ashutosh Bapat
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
@ 2026-05-05 06:00 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
1 sibling, 1 reply; 31+ messages in thread
From: Bertrand Drouvot @ 2026-05-05 06:00 UTC (permalink / raw)
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>
Hi,
On Thu, Apr 30, 2026 at 06:01:22PM +0530, Ashutosh Bapat wrote:
> On Thu, Apr 30, 2026 at 4:56 PM Bertrand Drouvot
> <bertranddrouvot.pg@gmail.com> wrote:
> >
> > I can see the the instability locally with en_US.UTF-8 (gt before _gt) and I
> > can see that, for example sifaka, has en_US.UTF-8 in locales. So, modifying the
> > impacted query a bit to add COLLATE "C" in the attached.
> >
>
> I did wonder where the instability is coming from the new query - it's
> because now we are traversing the entire dependency tree which also
> contains array type of reltype.
Right.
> I think we should just eliminate it
> from the result just like we are eliminating the rule. There is slight
> convenience in keeping the query as is - it need not change even
> though the columns returned by the function change and it's more
> readable. I also think that we don't need a type defined for a
> property graph - it doesn't contain any row as well as the shape of
> the result of GRAPH_TABLE depends upon the COLUMNS clause - so that's
> not fixed as well. I will start a separate thread for that discussion.
Yeah, now that 891a57c7394 is in, PFA a new version of the patch. This is just
a mandatory rebase and the COLLATE "C" removals.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Attachments:
[text/x-diff] v6-0001-Handle-element-label-and-element-label-property-o.patch (31.7K, ../../afmHd5vSCJtMFueS@bdtpg/2-v6-0001-Handle-element-label-and-element-label-property-o.patch)
download | inline diff:
From 322cd4e2fe26d032398c289ad30055dbb83551b4 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Thu, 23 Apr 2026 09:27:39 +0000
Subject: [PATCH] Handle element label and element label property objects in
object address functions
getObjectTypeDescription() and getObjectIdentityParts() do not handle objects in
pg_propgraph_element_label and pg_propgraph_label_property catalogs. These
functions when called for handling a DDL that affects these objects causes
"unsupported object class" error. An error is reported when these functions are
called when pg_identify_object() and pg_identify_object_as_address() are invoked
with objects from the said catalogs.
The objects in these catalogs do not have a (user given) name but they can be
manipulated invdividually through ALTER PROPERTY GRAPH sub-commands. Hence they
need to be accessible to the event triggers. Handle these catalogs in the
respective functions.
Reported-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://postgr.es/m/aej1DkLwhyZWmtxJ@bdtpg
---
src/backend/catalog/objectaddress.c | 111 ++++++++--
.../expected/create_property_graph.out | 189 ++++++++++--------
src/test/regress/expected/event_trigger.out | 22 ++
src/test/regress/expected/object_address.out | 9 +-
.../regress/sql/create_property_graph.sql | 31 ++-
src/test/regress/sql/event_trigger.sql | 15 ++
src/test/regress/sql/object_address.sql | 5 +-
7 files changed, 267 insertions(+), 115 deletions(-)
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index c1862809577..70058522b35 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -4106,26 +4106,19 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
case PropgraphElementLabelRelationId:
{
Relation rel;
- SysScanDesc scan;
- ScanKeyData key[1];
HeapTuple tuple;
Form_pg_propgraph_element_label pgelform;
ObjectAddress oa;
rel = table_open(PropgraphElementLabelRelationId, AccessShareLock);
- ScanKeyInit(&key[0],
- Anum_pg_propgraph_element_label_oid,
- BTEqualStrategyNumber, F_OIDEQ,
- ObjectIdGetDatum(object->objectId));
-
- scan = systable_beginscan(rel, PropgraphElementLabelObjectIndexId, true, NULL, 1, key);
- tuple = systable_getnext(scan);
+ tuple = get_catalog_object_by_oid(rel,
+ Anum_pg_propgraph_element_label_oid,
+ object->objectId);
if (!HeapTupleIsValid(tuple))
{
if (!missing_ok)
elog(ERROR, "could not find tuple for element label %u", object->objectId);
- systable_endscan(scan);
table_close(rel, AccessShareLock);
break;
}
@@ -4136,7 +4129,6 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
ObjectAddressSet(oa, PropgraphElementRelationId, pgelform->pgelelid);
appendStringInfoString(&buffer, getObjectDescription(&oa, false));
- systable_endscan(scan);
table_close(rel, AccessShareLock);
break;
}
@@ -4166,26 +4158,19 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
case PropgraphLabelPropertyRelationId:
{
Relation rel;
- SysScanDesc scan;
- ScanKeyData key[1];
HeapTuple tuple;
Form_pg_propgraph_label_property plpform;
ObjectAddress oa;
rel = table_open(PropgraphLabelPropertyRelationId, AccessShareLock);
- ScanKeyInit(&key[0],
- Anum_pg_propgraph_label_property_oid,
- BTEqualStrategyNumber, F_OIDEQ,
- ObjectIdGetDatum(object->objectId));
-
- scan = systable_beginscan(rel, PropgraphLabelPropertyObjectIndexId, true, NULL, 1, key);
- tuple = systable_getnext(scan);
+ tuple = get_catalog_object_by_oid(rel,
+ Anum_pg_propgraph_label_property_oid,
+ object->objectId);
if (!HeapTupleIsValid(tuple))
{
if (!missing_ok)
elog(ERROR, "could not find tuple for label property %u", object->objectId);
- systable_endscan(scan);
table_close(rel, AccessShareLock);
break;
}
@@ -4196,7 +4181,6 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
ObjectAddressSet(oa, PropgraphElementLabelRelationId, plpform->plpellabelid);
appendStringInfoString(&buffer, getObjectDescription(&oa, false));
- systable_endscan(scan);
table_close(rel, AccessShareLock);
break;
}
@@ -4913,6 +4897,14 @@ getObjectTypeDescription(const ObjectAddress *object, bool missing_ok)
appendStringInfoString(&buffer, "property graph property");
break;
+ case PropgraphElementLabelRelationId:
+ appendStringInfoString(&buffer, "property graph element label");
+ break;
+
+ case PropgraphLabelPropertyRelationId:
+ appendStringInfoString(&buffer, "property graph element label property");
+ break;
+
case PublicationRelationId:
appendStringInfoString(&buffer, "publication");
break;
@@ -6228,6 +6220,81 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
+ case PropgraphElementLabelRelationId:
+ {
+ Relation ellabelDesc;
+ HeapTuple tup;
+ Form_pg_propgraph_element_label pgelform;
+ ObjectAddress oa;
+ char *labelname;
+
+ ellabelDesc = table_open(PropgraphElementLabelRelationId, AccessShareLock);
+ tup = get_catalog_object_by_oid(ellabelDesc,
+ Anum_pg_propgraph_element_label_oid,
+ object->objectId);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for element label %u",
+ object->objectId);
+
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ pgelform = (Form_pg_propgraph_element_label) GETSTRUCT(tup);
+
+ labelname = get_propgraph_label_name(pgelform->pgellabelid);
+ appendStringInfo(&buffer, _("%s of "), quote_identifier(labelname));
+ ObjectAddressSet(oa, PropgraphElementRelationId, pgelform->pgelelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+ /* labelname is already pstrdup'ed. */
+ if (objname)
+ *objname = lappend(*objname, labelname);
+
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ case PropgraphLabelPropertyRelationId:
+ {
+ Relation lblpropDesc;
+ HeapTuple tup;
+ Form_pg_propgraph_label_property plpform;
+ ObjectAddress oa;
+ char *propname;
+
+ lblpropDesc = table_open(PropgraphLabelPropertyRelationId,
+ AccessShareLock);
+ tup = get_catalog_object_by_oid(lblpropDesc,
+ Anum_pg_propgraph_label_property_oid,
+ object->objectId);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for label property %u",
+ object->objectId);
+
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
+ plpform = (Form_pg_propgraph_label_property) GETSTRUCT(tup);
+
+ propname = get_propgraph_property_name(plpform->plppropid);
+ appendStringInfo(&buffer, _("%s of "), quote_identifier(propname));
+ ObjectAddressSet(oa, PropgraphElementLabelRelationId, plpform->plpellabelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+ /* propname is already pstrdup'ed. */
+ if (objname)
+ *objname = lappend(*objname, propname);
+
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
case PublicationRelationId:
{
char *pubname;
diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out
index 4fc4759f18e..844fb07a807 100644
--- a/src/test/regress/expected/create_property_graph.out
+++ b/src/test/regress/expected/create_property_graph.out
@@ -661,93 +661,122 @@ SELECT * FROM information_schema.pg_property_graph_privileges WHERE grantee LIKE
(2 rows)
-- test object address functions
+CREATE TEMPORARY VIEW deps_tree AS
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass AND
+ -- eliminate this view, which is not a real dependency, from the result
+ classid <> 'pg_rewrite'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ ) SELECT DISTINCT * FROM deps;
SELECT pg_describe_object(classid, objid, objsubid) as obj,
- pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2;
- obj | reference_graph
----------------------------------+-------------------
- edge e1 of property graph g2 | property graph g2
- edge e2 of property graph g2 | property graph g2
- label e1 of property graph g2 | property graph g2
- label e2 of property graph g2 | property graph g2
- label t1 of property graph g2 | property graph g2
- label t2 of property graph g2 | property graph g2
- label t3l1 of property graph g2 | property graph g2
- label t3l2 of property graph g2 | property graph g2
- property a of property graph g2 | property graph g2
- property b of property graph g2 | property graph g2
- property i of property graph g2 | property graph g2
- property j of property graph g2 | property graph g2
- property k of property graph g2 | property graph g2
- property t of property graph g2 | property graph g2
- property x of property graph g2 | property graph g2
- property y of property graph g2 | property graph g2
- property z of property graph g2 | property graph g2
- vertex t1 of property graph g2 | property graph g2
- vertex t2 of property graph g2 | property graph g2
- vertex t3 of property graph g2 | property graph g2
-(20 rows)
+ pg_describe_object(refclassid, refobjid, refobjsubid) as refobj
+ FROM deps_tree ORDER BY 1, 2;
+ obj | refobj
+----------------------------------------------------------+--------------------------------------------
+ edge e of property graph gt | property graph gt
+ edge e of property graph gt | vertex v1 of property graph gt
+ edge e of property graph gt | vertex v2 of property graph gt
+ label e of edge e of property graph gt | edge e of property graph gt
+ label e of edge e of property graph gt | label e of property graph gt
+ label e of property graph gt | property graph gt
+ label v1 of property graph gt | property graph gt
+ label v1 of vertex v1 of property graph gt | label v1 of property graph gt
+ label v1 of vertex v1 of property graph gt | vertex v1 of property graph gt
+ label v2 of property graph gt | property graph gt
+ label v2 of vertex v2 of property graph gt | label v2 of property graph gt
+ label v2 of vertex v2 of property graph gt | vertex v2 of property graph gt
+ property a of label v1 of vertex v1 of property graph gt | label v1 of vertex v1 of property graph gt
+ property a of label v1 of vertex v1 of property graph gt | property a of property graph gt
+ property a of property graph gt | property graph gt
+ property b of label v1 of vertex v1 of property graph gt | label v1 of vertex v1 of property graph gt
+ property b of label v1 of vertex v1 of property graph gt | property b of property graph gt
+ property b of property graph gt | property graph gt
+ property c of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property c of label e of edge e of property graph gt | property c of property graph gt
+ property c of property graph gt | property graph gt
+ property k1 of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property k1 of label e of edge e of property graph gt | property k1 of property graph gt
+ property k1 of property graph gt | property graph gt
+ property k2 of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property k2 of label e of edge e of property graph gt | property k2 of property graph gt
+ property k2 of property graph gt | property graph gt
+ property m of label v2 of vertex v2 of property graph gt | label v2 of vertex v2 of property graph gt
+ property m of label v2 of vertex v2 of property graph gt | property m of property graph gt
+ property m of property graph gt | property graph gt
+ property n of label v2 of vertex v2 of property graph gt | label v2 of vertex v2 of property graph gt
+ property n of label v2 of vertex v2 of property graph gt | property n of property graph gt
+ property n of property graph gt | property graph gt
+ vertex v1 of property graph gt | property graph gt
+ vertex v2 of property graph gt | property graph gt
+(35 rows)
SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3;
- type | object_names | object_args
--------------------------+---------------------------------------+-------------
- property graph element | {create_property_graph_tests,g2,e1} | {}
- property graph element | {create_property_graph_tests,g2,e2} | {}
- property graph element | {create_property_graph_tests,g2,t1} | {}
- property graph element | {create_property_graph_tests,g2,t2} | {}
- property graph element | {create_property_graph_tests,g2,t3} | {}
- property graph label | {create_property_graph_tests,g2,e1} | {}
- property graph label | {create_property_graph_tests,g2,e2} | {}
- property graph label | {create_property_graph_tests,g2,t1} | {}
- property graph label | {create_property_graph_tests,g2,t2} | {}
- property graph label | {create_property_graph_tests,g2,t3l1} | {}
- property graph label | {create_property_graph_tests,g2,t3l2} | {}
- property graph property | {create_property_graph_tests,g2,a} | {}
- property graph property | {create_property_graph_tests,g2,b} | {}
- property graph property | {create_property_graph_tests,g2,i} | {}
- property graph property | {create_property_graph_tests,g2,j} | {}
- property graph property | {create_property_graph_tests,g2,k} | {}
- property graph property | {create_property_graph_tests,g2,t} | {}
- property graph property | {create_property_graph_tests,g2,x} | {}
- property graph property | {create_property_graph_tests,g2,y} | {}
- property graph property | {create_property_graph_tests,g2,z} | {}
-(20 rows)
+ type | object_names | object_args
+---------------------------------------+------------------------------------------+-------------
+ property graph element | {create_property_graph_tests,gt,e} | {}
+ property graph element | {create_property_graph_tests,gt,v1} | {}
+ property graph element | {create_property_graph_tests,gt,v2} | {}
+ property graph element label | {create_property_graph_tests,gt,e,e} | {}
+ property graph element label | {create_property_graph_tests,gt,v1,v1} | {}
+ property graph element label | {create_property_graph_tests,gt,v2,v2} | {}
+ property graph element label property | {create_property_graph_tests,gt,e,e,c} | {}
+ property graph element label property | {create_property_graph_tests,gt,e,e,k1} | {}
+ property graph element label property | {create_property_graph_tests,gt,e,e,k2} | {}
+ property graph element label property | {create_property_graph_tests,gt,v1,v1,a} | {}
+ property graph element label property | {create_property_graph_tests,gt,v1,v1,b} | {}
+ property graph element label property | {create_property_graph_tests,gt,v2,v2,m} | {}
+ property graph element label property | {create_property_graph_tests,gt,v2,v2,n} | {}
+ property graph label | {create_property_graph_tests,gt,e} | {}
+ property graph label | {create_property_graph_tests,gt,v1} | {}
+ property graph label | {create_property_graph_tests,gt,v2} | {}
+ property graph property | {create_property_graph_tests,gt,a} | {}
+ property graph property | {create_property_graph_tests,gt,b} | {}
+ property graph property | {create_property_graph_tests,gt,c} | {}
+ property graph property | {create_property_graph_tests,gt,k1} | {}
+ property graph property | {create_property_graph_tests,gt,k2} | {}
+ property graph property | {create_property_graph_tests,gt,m} | {}
+ property graph property | {create_property_graph_tests,gt,n} | {}
+(23 rows)
SELECT (pg_identify_object(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3, 4;
- type | schema | name | identity
--------------------------+--------+------+----------------------------------------
- property graph element | | | e1 of create_property_graph_tests.g2
- property graph element | | | e2 of create_property_graph_tests.g2
- property graph element | | | t1 of create_property_graph_tests.g2
- property graph element | | | t2 of create_property_graph_tests.g2
- property graph element | | | t3 of create_property_graph_tests.g2
- property graph label | | | e1 of create_property_graph_tests.g2
- property graph label | | | e2 of create_property_graph_tests.g2
- property graph label | | | t1 of create_property_graph_tests.g2
- property graph label | | | t2 of create_property_graph_tests.g2
- property graph label | | | t3l1 of create_property_graph_tests.g2
- property graph label | | | t3l2 of create_property_graph_tests.g2
- property graph property | | | a of create_property_graph_tests.g2
- property graph property | | | b of create_property_graph_tests.g2
- property graph property | | | i of create_property_graph_tests.g2
- property graph property | | | j of create_property_graph_tests.g2
- property graph property | | | k of create_property_graph_tests.g2
- property graph property | | | t of create_property_graph_tests.g2
- property graph property | | | x of create_property_graph_tests.g2
- property graph property | | | y of create_property_graph_tests.g2
- property graph property | | | z of create_property_graph_tests.g2
-(20 rows)
+ type | schema | name | identity
+---------------------------------------+--------+------+-------------------------------------------------
+ property graph element | | | e of create_property_graph_tests.gt
+ property graph element | | | v1 of create_property_graph_tests.gt
+ property graph element | | | v2 of create_property_graph_tests.gt
+ property graph element label | | | e of e of create_property_graph_tests.gt
+ property graph element label | | | v1 of v1 of create_property_graph_tests.gt
+ property graph element label | | | v2 of v2 of create_property_graph_tests.gt
+ property graph element label property | | | a of v1 of v1 of create_property_graph_tests.gt
+ property graph element label property | | | b of v1 of v1 of create_property_graph_tests.gt
+ property graph element label property | | | c of e of e of create_property_graph_tests.gt
+ property graph element label property | | | k1 of e of e of create_property_graph_tests.gt
+ property graph element label property | | | k2 of e of e of create_property_graph_tests.gt
+ property graph element label property | | | m of v2 of v2 of create_property_graph_tests.gt
+ property graph element label property | | | n of v2 of v2 of create_property_graph_tests.gt
+ property graph label | | | e of create_property_graph_tests.gt
+ property graph label | | | v1 of create_property_graph_tests.gt
+ property graph label | | | v2 of create_property_graph_tests.gt
+ property graph property | | | a of create_property_graph_tests.gt
+ property graph property | | | b of create_property_graph_tests.gt
+ property graph property | | | c of create_property_graph_tests.gt
+ property graph property | | | k1 of create_property_graph_tests.gt
+ property graph property | | | k2 of create_property_graph_tests.gt
+ property graph property | | | m of create_property_graph_tests.gt
+ property graph property | | | n of create_property_graph_tests.gt
+(23 rows)
\a\t
SELECT pg_get_propgraphdef('g2'::regclass);
diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out
index 065f586310f..86ae50ce531 100644
--- a/src/test/regress/expected/event_trigger.out
+++ b/src/test/regress/expected/event_trigger.out
@@ -173,6 +173,28 @@ NOTICE: test_event_trigger: ddl_command_end CREATE USER MAPPING
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
NOTICE: test_event_trigger: ddl_command_end ALTER DEFAULT PRIVILEGES
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE tv1 (a int PRIMARY KEY, b text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE tv2 (i int PRIMARY KEY, j text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE te1 (p int PRIMARY KEY, a int REFERENCES tv1(a), b int REFERENCES tv2(i), q text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ tv1 LABEL l1 PROPERTIES (b AS p1),
+ tv2 LABEL l2 PROPERTIES (j AS p1))
+ EDGE TABLES (te1 SOURCE tv1 DESTINATION tv2 LABEL e1 PROPERTIES (q as p1));
+NOTICE: test_event_trigger: ddl_command_end CREATE PROPERTY GRAPH
+ALTER PROPERTY GRAPH gx ALTER EDGE TABLE te1 ALTER LABEL e1 DROP PROPERTIES (p1);
+NOTICE: test_event_trigger: ddl_command_end ALTER PROPERTY GRAPH
+DROP PROPERTY GRAPH gx;
+NOTICE: test_event_trigger: ddl_command_end DROP PROPERTY GRAPH
+DROP TABLE tv1, tv2, te1;
+NOTICE: test_event_trigger: ddl_command_end DROP TABLE
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
ERROR: permission denied to change owner of event trigger "regress_event_trigger"
diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out
index 97227d67a54..9f2d08398b0 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -67,7 +67,8 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph label'), ('property graph property'),
+ ('property graph element label'), ('property graph element label property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -86,6 +87,8 @@ WARNING: error for materialized view column: unsupported object type "materiali
WARNING: error for property graph element: unsupported object type "property graph element"
WARNING: error for property graph label: unsupported object type "property graph label"
WARNING: error for property graph property: unsupported object type "property graph property"
+WARNING: error for property graph element label: unrecognized object type "property graph element label"
+WARNING: error for property graph element label property: unrecognized object type "property graph element label property"
-- miscellaneous other errors
select * from pg_get_object_address('operator of access method', '{btree,integer_ops,1}', '{int4,bool}');
ERROR: operator 1 (int4, bool) of operator family integer_ops for access method btree does not exist
@@ -595,6 +598,8 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
('pg_publication_rel'::regclass, 0, 0), -- no publication relation
@@ -653,6 +658,8 @@ ORDER BY objects.classid, objects.objid, objects.objsubid;
("(""parameter ACL"",,,)")|("(""parameter ACL"",,)")|NULL
("(""property graph element"",,,)")|("(""property graph element"",,)")|NULL
("(""property graph label"",,,)")|("(""property graph label"",,)")|NULL
+("(""property graph element label"",,,)")|("(""property graph element label"",,)")|NULL
("(""property graph property"",,,)")|("(""property graph property"",,)")|NULL
+("(""property graph element label property"",,,)")|("(""property graph element label property"",,)")|NULL
-- restore normal output mode
\a\t
diff --git a/src/test/regress/sql/create_property_graph.sql b/src/test/regress/sql/create_property_graph.sql
index 241f93df302..85088ae632c 100644
--- a/src/test/regress/sql/create_property_graph.sql
+++ b/src/test/regress/sql/create_property_graph.sql
@@ -281,21 +281,30 @@ SELECT * FROM information_schema.pg_property_data_types ORDER BY property_graph_
SELECT * FROM information_schema.pg_property_graph_privileges WHERE grantee LIKE 'regress%' ORDER BY property_graph_name, grantor, grantee, privilege_type;
-- test object address functions
+CREATE TEMPORARY VIEW deps_tree AS
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass AND
+ -- eliminate this view, which is not a real dependency, from the result
+ classid <> 'pg_rewrite'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ ) SELECT DISTINCT * FROM deps;
+
SELECT pg_describe_object(classid, objid, objsubid) as obj,
- pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2;
+ pg_describe_object(refclassid, refobjid, refobjsubid) as refobj
+ FROM deps_tree ORDER BY 1, 2;
SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3;
SELECT (pg_identify_object(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3, 4;
\a\t
diff --git a/src/test/regress/sql/event_trigger.sql b/src/test/regress/sql/event_trigger.sql
index 32e9bb58c5e..d0e6ba295fe 100644
--- a/src/test/regress/sql/event_trigger.sql
+++ b/src/test/regress/sql/event_trigger.sql
@@ -143,6 +143,21 @@ create user mapping for regress_evt_user server useless_server;
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE tv1 (a int PRIMARY KEY, b text);
+CREATE TABLE tv2 (i int PRIMARY KEY, j text);
+CREATE TABLE te1 (p int PRIMARY KEY, a int REFERENCES tv1(a), b int REFERENCES tv2(i), q text);
+
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ tv1 LABEL l1 PROPERTIES (b AS p1),
+ tv2 LABEL l2 PROPERTIES (j AS p1))
+ EDGE TABLES (te1 SOURCE tv1 DESTINATION tv2 LABEL e1 PROPERTIES (q as p1));
+
+ALTER PROPERTY GRAPH gx ALTER EDGE TABLE te1 ALTER LABEL e1 DROP PROPERTIES (p1);
+DROP PROPERTY GRAPH gx;
+DROP TABLE tv1, tv2, te1;
+
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
diff --git a/src/test/regress/sql/object_address.sql b/src/test/regress/sql/object_address.sql
index 1bbe9457c1c..e987bd3542f 100644
--- a/src/test/regress/sql/object_address.sql
+++ b/src/test/regress/sql/object_address.sql
@@ -67,7 +67,8 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph label'), ('property graph property'),
+ ('property graph element label'), ('property graph element label property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -284,6 +285,8 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
('pg_publication_rel'::regclass, 0, 0), -- no publication relation
--
2.47.3
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
@ 2026-05-06 02:38 ` Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 31+ messages in thread
From: Alex Guo @ 2026-05-06 02:38 UTC (permalink / raw)
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>
On 5/5/26 2:00 PM, Bertrand Drouvot wrote:
> Hi,
>
> On Thu, Apr 30, 2026 at 06:01:22PM +0530, Ashutosh Bapat wrote:
>> On Thu, Apr 30, 2026 at 4:56 PM Bertrand Drouvot
>> <bertranddrouvot.pg@gmail.com> wrote:
>>> I can see the the instability locally with en_US.UTF-8 (gt before _gt) and I
>>> can see that, for example sifaka, has en_US.UTF-8 in locales. So, modifying the
>>> impacted query a bit to add COLLATE "C" in the attached.
>>>
>> I did wonder where the instability is coming from the new query - it's
>> because now we are traversing the entire dependency tree which also
>> contains array type of reltype.
> Right.
>
>> I think we should just eliminate it
>> from the result just like we are eliminating the rule. There is slight
>> convenience in keeping the query as is - it need not change even
>> though the columns returned by the function change and it's more
>> readable. I also think that we don't need a type defined for a
>> property graph - it doesn't contain any row as well as the shape of
>> the result of GRAPH_TABLE depends upon the COLUMNS clause - so that's
>> not fixed as well. I will start a separate thread for that discussion.
> Yeah, now that 891a57c7394 is in, PFA a new version of the patch. This is just
> a mandatory rebase and the COLLATE "C" removals.
>
> Regards,
Thanks for the patch. The patch overall LGTM. There is a typo in the commit message:
"manipulated invdividually through ALTER PROPERTY GRAPH sub-commands. Hence they”
invdividually -> individually
Regards,
Alex Guo
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
@ 2026-05-07 01:47 ` Michael Paquier <michael@paquier.xyz>
2026-05-07 09:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
0 siblings, 2 replies; 31+ messages in thread
From: Michael Paquier @ 2026-05-07 01:47 UTC (permalink / raw)
To: Alex Guo <guo.alex.hengchen@gmail.com>; +Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>
On Wed, May 06, 2026 at 10:38:32AM +0800, Alex Guo wrote:
> On 5/5/26 2:00 PM, Bertrand Drouvot wrote:
>> On Thu, Apr 30, 2026 at 06:01:22PM +0530, Ashutosh Bapat wrote:
>>> I think we should just eliminate it
>>> from the result just like we are eliminating the rule. There is slight
>>> convenience in keeping the query as is - it need not change even
>>> though the columns returned by the function change and it's more
>>> readable. I also think that we don't need a type defined for a
>>> property graph - it doesn't contain any row as well as the shape of
>>> the result of GRAPH_TABLE depends upon the COLUMNS clause - so that's
>>> not fixed as well. I will start a separate thread for that
>>> discussion.
>>
>> Yeah, now that 891a57c7394 is in, PFA a new version of the patch. This is just
>> a mandatory rebase and the COLLATE "C" removals.
In order to move the needle, I have applied the simplification of
getObjectDescription() as an independent piece.
Label properties lead to part descriptions like that:
+ property graph label property | | | k1 of e of e of
create_property_graph_tests.gt
+ property graph label property | | | k2 of e of e of
create_property_graph_tests.gt
This is confusing and hard to act on for the reader, with the same
object name defined twice (worse matter: twice in a row). For the
reader, is the first "e" something different than the second? Do both
refer to the same object? Do they refer to different sub-objects
instead but named the same because the implementation dictates so?
This could gain in clarity.
This has been mentioned upthread. But, while reviewing the rest, I am
really puzzled by your choice of "property graph element label
property" over "property graph label property", which is inconsistent
with the catalog description. We usually try to be careful about the
wordings of the descriptions with the statis data in objectaddress.c,
and the extra "element" feels out of place to me.
I'll let Peter comment about these points, but it really looks like
the intention of the catalog leads to a result closer to the attached
(leaving the label property description aside for a minute).
Attaching a rebased v7 with the remaining pieces.
--
Michael
From 0beda6b3613b05616988caa854fcbc45feeaf55b Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@paquier.xyz>
Date: Thu, 7 May 2026 10:45:12 +0900
Subject: [PATCH v7] Handle element label and element label property objects in
object address functions
getObjectTypeDescription() and getObjectIdentityParts() do not handle objects in
pg_propgraph_element_label and pg_propgraph_label_property catalogs. These
functions when called for handling a DDL that affects these objects causes
"unsupported object class" error. An error is reported when these functions are
called when pg_identify_object() and pg_identify_object_as_address() are invoked
with objects from the said catalogs.
The objects in these catalogs do not have a (user given) name but they can be
manipulated invdividually through ALTER PROPERTY GRAPH sub-commands. Hence they
need to be accessible to the event triggers. Handle these catalogs in the
respective functions.
Reported-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://postgr.es/m/aej1DkLwhyZWmtxJ@bdtpg
---
src/backend/catalog/objectaddress.c | 83 ++++++++
.../expected/create_property_graph.out | 189 ++++++++++--------
src/test/regress/expected/event_trigger.out | 22 ++
src/test/regress/expected/object_address.out | 9 +-
.../regress/sql/create_property_graph.sql | 31 ++-
src/test/regress/sql/event_trigger.sql | 15 ++
src/test/regress/sql/object_address.sql | 5 +-
7 files changed, 261 insertions(+), 93 deletions(-)
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index 050b7829eb0a..f814c8b9a409 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -4897,6 +4897,14 @@ getObjectTypeDescription(const ObjectAddress *object, bool missing_ok)
appendStringInfoString(&buffer, "property graph property");
break;
+ case PropgraphElementLabelRelationId:
+ appendStringInfoString(&buffer, "property graph element label");
+ break;
+
+ case PropgraphLabelPropertyRelationId:
+ appendStringInfoString(&buffer, "property graph label property");
+ break;
+
case PublicationRelationId:
appendStringInfoString(&buffer, "publication");
break;
@@ -6212,6 +6220,81 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
+ case PropgraphElementLabelRelationId:
+ {
+ Relation ellabelDesc;
+ HeapTuple tup;
+ Form_pg_propgraph_element_label pgelform;
+ ObjectAddress oa;
+ char *labelname;
+
+ ellabelDesc = table_open(PropgraphElementLabelRelationId, AccessShareLock);
+ tup = get_catalog_object_by_oid(ellabelDesc,
+ Anum_pg_propgraph_element_label_oid,
+ object->objectId);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for element label %u",
+ object->objectId);
+
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ pgelform = (Form_pg_propgraph_element_label) GETSTRUCT(tup);
+
+ labelname = get_propgraph_label_name(pgelform->pgellabelid);
+ appendStringInfo(&buffer, _("%s of "), quote_identifier(labelname));
+ ObjectAddressSet(oa, PropgraphElementRelationId, pgelform->pgelelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+ /* labelname is already pstrdup'ed. */
+ if (objname)
+ *objname = lappend(*objname, labelname);
+
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ case PropgraphLabelPropertyRelationId:
+ {
+ Relation lblpropDesc;
+ HeapTuple tup;
+ Form_pg_propgraph_label_property plpform;
+ ObjectAddress oa;
+ char *propname;
+
+ lblpropDesc = table_open(PropgraphLabelPropertyRelationId,
+ AccessShareLock);
+ tup = get_catalog_object_by_oid(lblpropDesc,
+ Anum_pg_propgraph_label_property_oid,
+ object->objectId);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for label property %u",
+ object->objectId);
+
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
+ plpform = (Form_pg_propgraph_label_property) GETSTRUCT(tup);
+
+ propname = get_propgraph_property_name(plpform->plppropid);
+ appendStringInfo(&buffer, _("%s of "), quote_identifier(propname));
+ ObjectAddressSet(oa, PropgraphElementLabelRelationId, plpform->plpellabelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+ /* propname is already pstrdup'ed. */
+ if (objname)
+ *objname = lappend(*objname, propname);
+
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
case PublicationRelationId:
{
char *pubname;
diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out
index 4fc4759f18e7..84d9248fa603 100644
--- a/src/test/regress/expected/create_property_graph.out
+++ b/src/test/regress/expected/create_property_graph.out
@@ -661,93 +661,122 @@ SELECT * FROM information_schema.pg_property_graph_privileges WHERE grantee LIKE
(2 rows)
-- test object address functions
+CREATE TEMPORARY VIEW deps_tree AS
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass AND
+ -- eliminate this view, which is not a real dependency, from the result
+ classid <> 'pg_rewrite'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ ) SELECT DISTINCT * FROM deps;
SELECT pg_describe_object(classid, objid, objsubid) as obj,
- pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2;
- obj | reference_graph
----------------------------------+-------------------
- edge e1 of property graph g2 | property graph g2
- edge e2 of property graph g2 | property graph g2
- label e1 of property graph g2 | property graph g2
- label e2 of property graph g2 | property graph g2
- label t1 of property graph g2 | property graph g2
- label t2 of property graph g2 | property graph g2
- label t3l1 of property graph g2 | property graph g2
- label t3l2 of property graph g2 | property graph g2
- property a of property graph g2 | property graph g2
- property b of property graph g2 | property graph g2
- property i of property graph g2 | property graph g2
- property j of property graph g2 | property graph g2
- property k of property graph g2 | property graph g2
- property t of property graph g2 | property graph g2
- property x of property graph g2 | property graph g2
- property y of property graph g2 | property graph g2
- property z of property graph g2 | property graph g2
- vertex t1 of property graph g2 | property graph g2
- vertex t2 of property graph g2 | property graph g2
- vertex t3 of property graph g2 | property graph g2
-(20 rows)
+ pg_describe_object(refclassid, refobjid, refobjsubid) as refobj
+ FROM deps_tree ORDER BY 1, 2;
+ obj | refobj
+----------------------------------------------------------+--------------------------------------------
+ edge e of property graph gt | property graph gt
+ edge e of property graph gt | vertex v1 of property graph gt
+ edge e of property graph gt | vertex v2 of property graph gt
+ label e of edge e of property graph gt | edge e of property graph gt
+ label e of edge e of property graph gt | label e of property graph gt
+ label e of property graph gt | property graph gt
+ label v1 of property graph gt | property graph gt
+ label v1 of vertex v1 of property graph gt | label v1 of property graph gt
+ label v1 of vertex v1 of property graph gt | vertex v1 of property graph gt
+ label v2 of property graph gt | property graph gt
+ label v2 of vertex v2 of property graph gt | label v2 of property graph gt
+ label v2 of vertex v2 of property graph gt | vertex v2 of property graph gt
+ property a of label v1 of vertex v1 of property graph gt | label v1 of vertex v1 of property graph gt
+ property a of label v1 of vertex v1 of property graph gt | property a of property graph gt
+ property a of property graph gt | property graph gt
+ property b of label v1 of vertex v1 of property graph gt | label v1 of vertex v1 of property graph gt
+ property b of label v1 of vertex v1 of property graph gt | property b of property graph gt
+ property b of property graph gt | property graph gt
+ property c of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property c of label e of edge e of property graph gt | property c of property graph gt
+ property c of property graph gt | property graph gt
+ property k1 of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property k1 of label e of edge e of property graph gt | property k1 of property graph gt
+ property k1 of property graph gt | property graph gt
+ property k2 of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property k2 of label e of edge e of property graph gt | property k2 of property graph gt
+ property k2 of property graph gt | property graph gt
+ property m of label v2 of vertex v2 of property graph gt | label v2 of vertex v2 of property graph gt
+ property m of label v2 of vertex v2 of property graph gt | property m of property graph gt
+ property m of property graph gt | property graph gt
+ property n of label v2 of vertex v2 of property graph gt | label v2 of vertex v2 of property graph gt
+ property n of label v2 of vertex v2 of property graph gt | property n of property graph gt
+ property n of property graph gt | property graph gt
+ vertex v1 of property graph gt | property graph gt
+ vertex v2 of property graph gt | property graph gt
+(35 rows)
SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3;
- type | object_names | object_args
--------------------------+---------------------------------------+-------------
- property graph element | {create_property_graph_tests,g2,e1} | {}
- property graph element | {create_property_graph_tests,g2,e2} | {}
- property graph element | {create_property_graph_tests,g2,t1} | {}
- property graph element | {create_property_graph_tests,g2,t2} | {}
- property graph element | {create_property_graph_tests,g2,t3} | {}
- property graph label | {create_property_graph_tests,g2,e1} | {}
- property graph label | {create_property_graph_tests,g2,e2} | {}
- property graph label | {create_property_graph_tests,g2,t1} | {}
- property graph label | {create_property_graph_tests,g2,t2} | {}
- property graph label | {create_property_graph_tests,g2,t3l1} | {}
- property graph label | {create_property_graph_tests,g2,t3l2} | {}
- property graph property | {create_property_graph_tests,g2,a} | {}
- property graph property | {create_property_graph_tests,g2,b} | {}
- property graph property | {create_property_graph_tests,g2,i} | {}
- property graph property | {create_property_graph_tests,g2,j} | {}
- property graph property | {create_property_graph_tests,g2,k} | {}
- property graph property | {create_property_graph_tests,g2,t} | {}
- property graph property | {create_property_graph_tests,g2,x} | {}
- property graph property | {create_property_graph_tests,g2,y} | {}
- property graph property | {create_property_graph_tests,g2,z} | {}
-(20 rows)
+ type | object_names | object_args
+-------------------------------+------------------------------------------+-------------
+ property graph element | {create_property_graph_tests,gt,e} | {}
+ property graph element | {create_property_graph_tests,gt,v1} | {}
+ property graph element | {create_property_graph_tests,gt,v2} | {}
+ property graph element label | {create_property_graph_tests,gt,e,e} | {}
+ property graph element label | {create_property_graph_tests,gt,v1,v1} | {}
+ property graph element label | {create_property_graph_tests,gt,v2,v2} | {}
+ property graph label | {create_property_graph_tests,gt,e} | {}
+ property graph label | {create_property_graph_tests,gt,v1} | {}
+ property graph label | {create_property_graph_tests,gt,v2} | {}
+ property graph label property | {create_property_graph_tests,gt,e,e,c} | {}
+ property graph label property | {create_property_graph_tests,gt,e,e,k1} | {}
+ property graph label property | {create_property_graph_tests,gt,e,e,k2} | {}
+ property graph label property | {create_property_graph_tests,gt,v1,v1,a} | {}
+ property graph label property | {create_property_graph_tests,gt,v1,v1,b} | {}
+ property graph label property | {create_property_graph_tests,gt,v2,v2,m} | {}
+ property graph label property | {create_property_graph_tests,gt,v2,v2,n} | {}
+ property graph property | {create_property_graph_tests,gt,a} | {}
+ property graph property | {create_property_graph_tests,gt,b} | {}
+ property graph property | {create_property_graph_tests,gt,c} | {}
+ property graph property | {create_property_graph_tests,gt,k1} | {}
+ property graph property | {create_property_graph_tests,gt,k2} | {}
+ property graph property | {create_property_graph_tests,gt,m} | {}
+ property graph property | {create_property_graph_tests,gt,n} | {}
+(23 rows)
SELECT (pg_identify_object(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3, 4;
- type | schema | name | identity
--------------------------+--------+------+----------------------------------------
- property graph element | | | e1 of create_property_graph_tests.g2
- property graph element | | | e2 of create_property_graph_tests.g2
- property graph element | | | t1 of create_property_graph_tests.g2
- property graph element | | | t2 of create_property_graph_tests.g2
- property graph element | | | t3 of create_property_graph_tests.g2
- property graph label | | | e1 of create_property_graph_tests.g2
- property graph label | | | e2 of create_property_graph_tests.g2
- property graph label | | | t1 of create_property_graph_tests.g2
- property graph label | | | t2 of create_property_graph_tests.g2
- property graph label | | | t3l1 of create_property_graph_tests.g2
- property graph label | | | t3l2 of create_property_graph_tests.g2
- property graph property | | | a of create_property_graph_tests.g2
- property graph property | | | b of create_property_graph_tests.g2
- property graph property | | | i of create_property_graph_tests.g2
- property graph property | | | j of create_property_graph_tests.g2
- property graph property | | | k of create_property_graph_tests.g2
- property graph property | | | t of create_property_graph_tests.g2
- property graph property | | | x of create_property_graph_tests.g2
- property graph property | | | y of create_property_graph_tests.g2
- property graph property | | | z of create_property_graph_tests.g2
-(20 rows)
+ type | schema | name | identity
+-------------------------------+--------+------+-------------------------------------------------
+ property graph element | | | e of create_property_graph_tests.gt
+ property graph element | | | v1 of create_property_graph_tests.gt
+ property graph element | | | v2 of create_property_graph_tests.gt
+ property graph element label | | | e of e of create_property_graph_tests.gt
+ property graph element label | | | v1 of v1 of create_property_graph_tests.gt
+ property graph element label | | | v2 of v2 of create_property_graph_tests.gt
+ property graph label | | | e of create_property_graph_tests.gt
+ property graph label | | | v1 of create_property_graph_tests.gt
+ property graph label | | | v2 of create_property_graph_tests.gt
+ property graph label property | | | a of v1 of v1 of create_property_graph_tests.gt
+ property graph label property | | | b of v1 of v1 of create_property_graph_tests.gt
+ property graph label property | | | c of e of e of create_property_graph_tests.gt
+ property graph label property | | | k1 of e of e of create_property_graph_tests.gt
+ property graph label property | | | k2 of e of e of create_property_graph_tests.gt
+ property graph label property | | | m of v2 of v2 of create_property_graph_tests.gt
+ property graph label property | | | n of v2 of v2 of create_property_graph_tests.gt
+ property graph property | | | a of create_property_graph_tests.gt
+ property graph property | | | b of create_property_graph_tests.gt
+ property graph property | | | c of create_property_graph_tests.gt
+ property graph property | | | k1 of create_property_graph_tests.gt
+ property graph property | | | k2 of create_property_graph_tests.gt
+ property graph property | | | m of create_property_graph_tests.gt
+ property graph property | | | n of create_property_graph_tests.gt
+(23 rows)
\a\t
SELECT pg_get_propgraphdef('g2'::regclass);
diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out
index 065f586310ff..86ae50ce5311 100644
--- a/src/test/regress/expected/event_trigger.out
+++ b/src/test/regress/expected/event_trigger.out
@@ -173,6 +173,28 @@ NOTICE: test_event_trigger: ddl_command_end CREATE USER MAPPING
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
NOTICE: test_event_trigger: ddl_command_end ALTER DEFAULT PRIVILEGES
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE tv1 (a int PRIMARY KEY, b text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE tv2 (i int PRIMARY KEY, j text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE te1 (p int PRIMARY KEY, a int REFERENCES tv1(a), b int REFERENCES tv2(i), q text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ tv1 LABEL l1 PROPERTIES (b AS p1),
+ tv2 LABEL l2 PROPERTIES (j AS p1))
+ EDGE TABLES (te1 SOURCE tv1 DESTINATION tv2 LABEL e1 PROPERTIES (q as p1));
+NOTICE: test_event_trigger: ddl_command_end CREATE PROPERTY GRAPH
+ALTER PROPERTY GRAPH gx ALTER EDGE TABLE te1 ALTER LABEL e1 DROP PROPERTIES (p1);
+NOTICE: test_event_trigger: ddl_command_end ALTER PROPERTY GRAPH
+DROP PROPERTY GRAPH gx;
+NOTICE: test_event_trigger: ddl_command_end DROP PROPERTY GRAPH
+DROP TABLE tv1, tv2, te1;
+NOTICE: test_event_trigger: ddl_command_end DROP TABLE
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
ERROR: permission denied to change owner of event trigger "regress_event_trigger"
diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out
index 97227d67a541..3fc8345e8486 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -67,7 +67,8 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph label'), ('property graph property'),
+ ('property graph element label'), ('property graph label property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -86,6 +87,8 @@ WARNING: error for materialized view column: unsupported object type "materiali
WARNING: error for property graph element: unsupported object type "property graph element"
WARNING: error for property graph label: unsupported object type "property graph label"
WARNING: error for property graph property: unsupported object type "property graph property"
+WARNING: error for property graph element label: unrecognized object type "property graph element label"
+WARNING: error for property graph label property: unrecognized object type "property graph label property"
-- miscellaneous other errors
select * from pg_get_object_address('operator of access method', '{btree,integer_ops,1}', '{int4,bool}');
ERROR: operator 1 (int4, bool) of operator family integer_ops for access method btree does not exist
@@ -595,6 +598,8 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
('pg_publication_rel'::regclass, 0, 0), -- no publication relation
@@ -653,6 +658,8 @@ ORDER BY objects.classid, objects.objid, objects.objsubid;
("(""parameter ACL"",,,)")|("(""parameter ACL"",,)")|NULL
("(""property graph element"",,,)")|("(""property graph element"",,)")|NULL
("(""property graph label"",,,)")|("(""property graph label"",,)")|NULL
+("(""property graph element label"",,,)")|("(""property graph element label"",,)")|NULL
("(""property graph property"",,,)")|("(""property graph property"",,)")|NULL
+("(""property graph label property"",,,)")|("(""property graph label property"",,)")|NULL
-- restore normal output mode
\a\t
diff --git a/src/test/regress/sql/create_property_graph.sql b/src/test/regress/sql/create_property_graph.sql
index 241f93df3028..85088ae632c7 100644
--- a/src/test/regress/sql/create_property_graph.sql
+++ b/src/test/regress/sql/create_property_graph.sql
@@ -281,21 +281,30 @@ SELECT * FROM information_schema.pg_property_data_types ORDER BY property_graph_
SELECT * FROM information_schema.pg_property_graph_privileges WHERE grantee LIKE 'regress%' ORDER BY property_graph_name, grantor, grantee, privilege_type;
-- test object address functions
+CREATE TEMPORARY VIEW deps_tree AS
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass AND
+ -- eliminate this view, which is not a real dependency, from the result
+ classid <> 'pg_rewrite'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ ) SELECT DISTINCT * FROM deps;
+
SELECT pg_describe_object(classid, objid, objsubid) as obj,
- pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2;
+ pg_describe_object(refclassid, refobjid, refobjsubid) as refobj
+ FROM deps_tree ORDER BY 1, 2;
SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3;
SELECT (pg_identify_object(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3, 4;
\a\t
diff --git a/src/test/regress/sql/event_trigger.sql b/src/test/regress/sql/event_trigger.sql
index 32e9bb58c5e9..d0e6ba295fe2 100644
--- a/src/test/regress/sql/event_trigger.sql
+++ b/src/test/regress/sql/event_trigger.sql
@@ -143,6 +143,21 @@ create user mapping for regress_evt_user server useless_server;
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE tv1 (a int PRIMARY KEY, b text);
+CREATE TABLE tv2 (i int PRIMARY KEY, j text);
+CREATE TABLE te1 (p int PRIMARY KEY, a int REFERENCES tv1(a), b int REFERENCES tv2(i), q text);
+
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ tv1 LABEL l1 PROPERTIES (b AS p1),
+ tv2 LABEL l2 PROPERTIES (j AS p1))
+ EDGE TABLES (te1 SOURCE tv1 DESTINATION tv2 LABEL e1 PROPERTIES (q as p1));
+
+ALTER PROPERTY GRAPH gx ALTER EDGE TABLE te1 ALTER LABEL e1 DROP PROPERTIES (p1);
+DROP PROPERTY GRAPH gx;
+DROP TABLE tv1, tv2, te1;
+
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
diff --git a/src/test/regress/sql/object_address.sql b/src/test/regress/sql/object_address.sql
index 1bbe9457c1ca..ed795a32e22a 100644
--- a/src/test/regress/sql/object_address.sql
+++ b/src/test/regress/sql/object_address.sql
@@ -67,7 +67,8 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph label'), ('property graph property'),
+ ('property graph element label'), ('property graph label property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -284,6 +285,8 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
('pg_publication_rel'::regclass, 0, 0), -- no publication relation
--
2.54.0
Attachments:
[text/plain] v7-0001-Handle-element-label-and-element-label-property-o.patch (28.6K, ../../afvvNP8b6QEfCNsQ@paquier.xyz/2-v7-0001-Handle-element-label-and-element-label-property-o.patch)
download | inline diff:
From 0beda6b3613b05616988caa854fcbc45feeaf55b Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@paquier.xyz>
Date: Thu, 7 May 2026 10:45:12 +0900
Subject: [PATCH v7] Handle element label and element label property objects in
object address functions
getObjectTypeDescription() and getObjectIdentityParts() do not handle objects in
pg_propgraph_element_label and pg_propgraph_label_property catalogs. These
functions when called for handling a DDL that affects these objects causes
"unsupported object class" error. An error is reported when these functions are
called when pg_identify_object() and pg_identify_object_as_address() are invoked
with objects from the said catalogs.
The objects in these catalogs do not have a (user given) name but they can be
manipulated invdividually through ALTER PROPERTY GRAPH sub-commands. Hence they
need to be accessible to the event triggers. Handle these catalogs in the
respective functions.
Reported-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://postgr.es/m/aej1DkLwhyZWmtxJ@bdtpg
---
src/backend/catalog/objectaddress.c | 83 ++++++++
.../expected/create_property_graph.out | 189 ++++++++++--------
src/test/regress/expected/event_trigger.out | 22 ++
src/test/regress/expected/object_address.out | 9 +-
.../regress/sql/create_property_graph.sql | 31 ++-
src/test/regress/sql/event_trigger.sql | 15 ++
src/test/regress/sql/object_address.sql | 5 +-
7 files changed, 261 insertions(+), 93 deletions(-)
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index 050b7829eb0a..f814c8b9a409 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -4897,6 +4897,14 @@ getObjectTypeDescription(const ObjectAddress *object, bool missing_ok)
appendStringInfoString(&buffer, "property graph property");
break;
+ case PropgraphElementLabelRelationId:
+ appendStringInfoString(&buffer, "property graph element label");
+ break;
+
+ case PropgraphLabelPropertyRelationId:
+ appendStringInfoString(&buffer, "property graph label property");
+ break;
+
case PublicationRelationId:
appendStringInfoString(&buffer, "publication");
break;
@@ -6212,6 +6220,81 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
+ case PropgraphElementLabelRelationId:
+ {
+ Relation ellabelDesc;
+ HeapTuple tup;
+ Form_pg_propgraph_element_label pgelform;
+ ObjectAddress oa;
+ char *labelname;
+
+ ellabelDesc = table_open(PropgraphElementLabelRelationId, AccessShareLock);
+ tup = get_catalog_object_by_oid(ellabelDesc,
+ Anum_pg_propgraph_element_label_oid,
+ object->objectId);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for element label %u",
+ object->objectId);
+
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ pgelform = (Form_pg_propgraph_element_label) GETSTRUCT(tup);
+
+ labelname = get_propgraph_label_name(pgelform->pgellabelid);
+ appendStringInfo(&buffer, _("%s of "), quote_identifier(labelname));
+ ObjectAddressSet(oa, PropgraphElementRelationId, pgelform->pgelelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+ /* labelname is already pstrdup'ed. */
+ if (objname)
+ *objname = lappend(*objname, labelname);
+
+ table_close(ellabelDesc, AccessShareLock);
+ break;
+ }
+
+ case PropgraphLabelPropertyRelationId:
+ {
+ Relation lblpropDesc;
+ HeapTuple tup;
+ Form_pg_propgraph_label_property plpform;
+ ObjectAddress oa;
+ char *propname;
+
+ lblpropDesc = table_open(PropgraphLabelPropertyRelationId,
+ AccessShareLock);
+ tup = get_catalog_object_by_oid(lblpropDesc,
+ Anum_pg_propgraph_label_property_oid,
+ object->objectId);
+ if (!HeapTupleIsValid(tup))
+ {
+ if (!missing_ok)
+ elog(ERROR, "could not find tuple for label property %u",
+ object->objectId);
+
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
+ plpform = (Form_pg_propgraph_label_property) GETSTRUCT(tup);
+
+ propname = get_propgraph_property_name(plpform->plppropid);
+ appendStringInfo(&buffer, _("%s of "), quote_identifier(propname));
+ ObjectAddressSet(oa, PropgraphElementLabelRelationId, plpform->plpellabelid);
+ appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
+ objargs, false));
+ /* propname is already pstrdup'ed. */
+ if (objname)
+ *objname = lappend(*objname, propname);
+
+ table_close(lblpropDesc, AccessShareLock);
+ break;
+ }
+
case PublicationRelationId:
{
char *pubname;
diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out
index 4fc4759f18e7..84d9248fa603 100644
--- a/src/test/regress/expected/create_property_graph.out
+++ b/src/test/regress/expected/create_property_graph.out
@@ -661,93 +661,122 @@ SELECT * FROM information_schema.pg_property_graph_privileges WHERE grantee LIKE
(2 rows)
-- test object address functions
+CREATE TEMPORARY VIEW deps_tree AS
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass AND
+ -- eliminate this view, which is not a real dependency, from the result
+ classid <> 'pg_rewrite'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ ) SELECT DISTINCT * FROM deps;
SELECT pg_describe_object(classid, objid, objsubid) as obj,
- pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2;
- obj | reference_graph
----------------------------------+-------------------
- edge e1 of property graph g2 | property graph g2
- edge e2 of property graph g2 | property graph g2
- label e1 of property graph g2 | property graph g2
- label e2 of property graph g2 | property graph g2
- label t1 of property graph g2 | property graph g2
- label t2 of property graph g2 | property graph g2
- label t3l1 of property graph g2 | property graph g2
- label t3l2 of property graph g2 | property graph g2
- property a of property graph g2 | property graph g2
- property b of property graph g2 | property graph g2
- property i of property graph g2 | property graph g2
- property j of property graph g2 | property graph g2
- property k of property graph g2 | property graph g2
- property t of property graph g2 | property graph g2
- property x of property graph g2 | property graph g2
- property y of property graph g2 | property graph g2
- property z of property graph g2 | property graph g2
- vertex t1 of property graph g2 | property graph g2
- vertex t2 of property graph g2 | property graph g2
- vertex t3 of property graph g2 | property graph g2
-(20 rows)
+ pg_describe_object(refclassid, refobjid, refobjsubid) as refobj
+ FROM deps_tree ORDER BY 1, 2;
+ obj | refobj
+----------------------------------------------------------+--------------------------------------------
+ edge e of property graph gt | property graph gt
+ edge e of property graph gt | vertex v1 of property graph gt
+ edge e of property graph gt | vertex v2 of property graph gt
+ label e of edge e of property graph gt | edge e of property graph gt
+ label e of edge e of property graph gt | label e of property graph gt
+ label e of property graph gt | property graph gt
+ label v1 of property graph gt | property graph gt
+ label v1 of vertex v1 of property graph gt | label v1 of property graph gt
+ label v1 of vertex v1 of property graph gt | vertex v1 of property graph gt
+ label v2 of property graph gt | property graph gt
+ label v2 of vertex v2 of property graph gt | label v2 of property graph gt
+ label v2 of vertex v2 of property graph gt | vertex v2 of property graph gt
+ property a of label v1 of vertex v1 of property graph gt | label v1 of vertex v1 of property graph gt
+ property a of label v1 of vertex v1 of property graph gt | property a of property graph gt
+ property a of property graph gt | property graph gt
+ property b of label v1 of vertex v1 of property graph gt | label v1 of vertex v1 of property graph gt
+ property b of label v1 of vertex v1 of property graph gt | property b of property graph gt
+ property b of property graph gt | property graph gt
+ property c of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property c of label e of edge e of property graph gt | property c of property graph gt
+ property c of property graph gt | property graph gt
+ property k1 of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property k1 of label e of edge e of property graph gt | property k1 of property graph gt
+ property k1 of property graph gt | property graph gt
+ property k2 of label e of edge e of property graph gt | label e of edge e of property graph gt
+ property k2 of label e of edge e of property graph gt | property k2 of property graph gt
+ property k2 of property graph gt | property graph gt
+ property m of label v2 of vertex v2 of property graph gt | label v2 of vertex v2 of property graph gt
+ property m of label v2 of vertex v2 of property graph gt | property m of property graph gt
+ property m of property graph gt | property graph gt
+ property n of label v2 of vertex v2 of property graph gt | label v2 of vertex v2 of property graph gt
+ property n of label v2 of vertex v2 of property graph gt | property n of property graph gt
+ property n of property graph gt | property graph gt
+ vertex v1 of property graph gt | property graph gt
+ vertex v2 of property graph gt | property graph gt
+(35 rows)
SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3;
- type | object_names | object_args
--------------------------+---------------------------------------+-------------
- property graph element | {create_property_graph_tests,g2,e1} | {}
- property graph element | {create_property_graph_tests,g2,e2} | {}
- property graph element | {create_property_graph_tests,g2,t1} | {}
- property graph element | {create_property_graph_tests,g2,t2} | {}
- property graph element | {create_property_graph_tests,g2,t3} | {}
- property graph label | {create_property_graph_tests,g2,e1} | {}
- property graph label | {create_property_graph_tests,g2,e2} | {}
- property graph label | {create_property_graph_tests,g2,t1} | {}
- property graph label | {create_property_graph_tests,g2,t2} | {}
- property graph label | {create_property_graph_tests,g2,t3l1} | {}
- property graph label | {create_property_graph_tests,g2,t3l2} | {}
- property graph property | {create_property_graph_tests,g2,a} | {}
- property graph property | {create_property_graph_tests,g2,b} | {}
- property graph property | {create_property_graph_tests,g2,i} | {}
- property graph property | {create_property_graph_tests,g2,j} | {}
- property graph property | {create_property_graph_tests,g2,k} | {}
- property graph property | {create_property_graph_tests,g2,t} | {}
- property graph property | {create_property_graph_tests,g2,x} | {}
- property graph property | {create_property_graph_tests,g2,y} | {}
- property graph property | {create_property_graph_tests,g2,z} | {}
-(20 rows)
+ type | object_names | object_args
+-------------------------------+------------------------------------------+-------------
+ property graph element | {create_property_graph_tests,gt,e} | {}
+ property graph element | {create_property_graph_tests,gt,v1} | {}
+ property graph element | {create_property_graph_tests,gt,v2} | {}
+ property graph element label | {create_property_graph_tests,gt,e,e} | {}
+ property graph element label | {create_property_graph_tests,gt,v1,v1} | {}
+ property graph element label | {create_property_graph_tests,gt,v2,v2} | {}
+ property graph label | {create_property_graph_tests,gt,e} | {}
+ property graph label | {create_property_graph_tests,gt,v1} | {}
+ property graph label | {create_property_graph_tests,gt,v2} | {}
+ property graph label property | {create_property_graph_tests,gt,e,e,c} | {}
+ property graph label property | {create_property_graph_tests,gt,e,e,k1} | {}
+ property graph label property | {create_property_graph_tests,gt,e,e,k2} | {}
+ property graph label property | {create_property_graph_tests,gt,v1,v1,a} | {}
+ property graph label property | {create_property_graph_tests,gt,v1,v1,b} | {}
+ property graph label property | {create_property_graph_tests,gt,v2,v2,m} | {}
+ property graph label property | {create_property_graph_tests,gt,v2,v2,n} | {}
+ property graph property | {create_property_graph_tests,gt,a} | {}
+ property graph property | {create_property_graph_tests,gt,b} | {}
+ property graph property | {create_property_graph_tests,gt,c} | {}
+ property graph property | {create_property_graph_tests,gt,k1} | {}
+ property graph property | {create_property_graph_tests,gt,k2} | {}
+ property graph property | {create_property_graph_tests,gt,m} | {}
+ property graph property | {create_property_graph_tests,gt,n} | {}
+(23 rows)
SELECT (pg_identify_object(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3, 4;
- type | schema | name | identity
--------------------------+--------+------+----------------------------------------
- property graph element | | | e1 of create_property_graph_tests.g2
- property graph element | | | e2 of create_property_graph_tests.g2
- property graph element | | | t1 of create_property_graph_tests.g2
- property graph element | | | t2 of create_property_graph_tests.g2
- property graph element | | | t3 of create_property_graph_tests.g2
- property graph label | | | e1 of create_property_graph_tests.g2
- property graph label | | | e2 of create_property_graph_tests.g2
- property graph label | | | t1 of create_property_graph_tests.g2
- property graph label | | | t2 of create_property_graph_tests.g2
- property graph label | | | t3l1 of create_property_graph_tests.g2
- property graph label | | | t3l2 of create_property_graph_tests.g2
- property graph property | | | a of create_property_graph_tests.g2
- property graph property | | | b of create_property_graph_tests.g2
- property graph property | | | i of create_property_graph_tests.g2
- property graph property | | | j of create_property_graph_tests.g2
- property graph property | | | k of create_property_graph_tests.g2
- property graph property | | | t of create_property_graph_tests.g2
- property graph property | | | x of create_property_graph_tests.g2
- property graph property | | | y of create_property_graph_tests.g2
- property graph property | | | z of create_property_graph_tests.g2
-(20 rows)
+ type | schema | name | identity
+-------------------------------+--------+------+-------------------------------------------------
+ property graph element | | | e of create_property_graph_tests.gt
+ property graph element | | | v1 of create_property_graph_tests.gt
+ property graph element | | | v2 of create_property_graph_tests.gt
+ property graph element label | | | e of e of create_property_graph_tests.gt
+ property graph element label | | | v1 of v1 of create_property_graph_tests.gt
+ property graph element label | | | v2 of v2 of create_property_graph_tests.gt
+ property graph label | | | e of create_property_graph_tests.gt
+ property graph label | | | v1 of create_property_graph_tests.gt
+ property graph label | | | v2 of create_property_graph_tests.gt
+ property graph label property | | | a of v1 of v1 of create_property_graph_tests.gt
+ property graph label property | | | b of v1 of v1 of create_property_graph_tests.gt
+ property graph label property | | | c of e of e of create_property_graph_tests.gt
+ property graph label property | | | k1 of e of e of create_property_graph_tests.gt
+ property graph label property | | | k2 of e of e of create_property_graph_tests.gt
+ property graph label property | | | m of v2 of v2 of create_property_graph_tests.gt
+ property graph label property | | | n of v2 of v2 of create_property_graph_tests.gt
+ property graph property | | | a of create_property_graph_tests.gt
+ property graph property | | | b of create_property_graph_tests.gt
+ property graph property | | | c of create_property_graph_tests.gt
+ property graph property | | | k1 of create_property_graph_tests.gt
+ property graph property | | | k2 of create_property_graph_tests.gt
+ property graph property | | | m of create_property_graph_tests.gt
+ property graph property | | | n of create_property_graph_tests.gt
+(23 rows)
\a\t
SELECT pg_get_propgraphdef('g2'::regclass);
diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out
index 065f586310ff..86ae50ce5311 100644
--- a/src/test/regress/expected/event_trigger.out
+++ b/src/test/regress/expected/event_trigger.out
@@ -173,6 +173,28 @@ NOTICE: test_event_trigger: ddl_command_end CREATE USER MAPPING
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
NOTICE: test_event_trigger: ddl_command_end ALTER DEFAULT PRIVILEGES
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE tv1 (a int PRIMARY KEY, b text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE tv2 (i int PRIMARY KEY, j text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE TABLE te1 (p int PRIMARY KEY, a int REFERENCES tv1(a), b int REFERENCES tv2(i), q text);
+NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ tv1 LABEL l1 PROPERTIES (b AS p1),
+ tv2 LABEL l2 PROPERTIES (j AS p1))
+ EDGE TABLES (te1 SOURCE tv1 DESTINATION tv2 LABEL e1 PROPERTIES (q as p1));
+NOTICE: test_event_trigger: ddl_command_end CREATE PROPERTY GRAPH
+ALTER PROPERTY GRAPH gx ALTER EDGE TABLE te1 ALTER LABEL e1 DROP PROPERTIES (p1);
+NOTICE: test_event_trigger: ddl_command_end ALTER PROPERTY GRAPH
+DROP PROPERTY GRAPH gx;
+NOTICE: test_event_trigger: ddl_command_end DROP PROPERTY GRAPH
+DROP TABLE tv1, tv2, te1;
+NOTICE: test_event_trigger: ddl_command_end DROP TABLE
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
ERROR: permission denied to change owner of event trigger "regress_event_trigger"
diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out
index 97227d67a541..3fc8345e8486 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -67,7 +67,8 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph label'), ('property graph property'),
+ ('property graph element label'), ('property graph label property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -86,6 +87,8 @@ WARNING: error for materialized view column: unsupported object type "materiali
WARNING: error for property graph element: unsupported object type "property graph element"
WARNING: error for property graph label: unsupported object type "property graph label"
WARNING: error for property graph property: unsupported object type "property graph property"
+WARNING: error for property graph element label: unrecognized object type "property graph element label"
+WARNING: error for property graph label property: unrecognized object type "property graph label property"
-- miscellaneous other errors
select * from pg_get_object_address('operator of access method', '{btree,integer_ops,1}', '{int4,bool}');
ERROR: operator 1 (int4, bool) of operator family integer_ops for access method btree does not exist
@@ -595,6 +598,8 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
('pg_publication_rel'::regclass, 0, 0), -- no publication relation
@@ -653,6 +658,8 @@ ORDER BY objects.classid, objects.objid, objects.objsubid;
("(""parameter ACL"",,,)")|("(""parameter ACL"",,)")|NULL
("(""property graph element"",,,)")|("(""property graph element"",,)")|NULL
("(""property graph label"",,,)")|("(""property graph label"",,)")|NULL
+("(""property graph element label"",,,)")|("(""property graph element label"",,)")|NULL
("(""property graph property"",,,)")|("(""property graph property"",,)")|NULL
+("(""property graph label property"",,,)")|("(""property graph label property"",,)")|NULL
-- restore normal output mode
\a\t
diff --git a/src/test/regress/sql/create_property_graph.sql b/src/test/regress/sql/create_property_graph.sql
index 241f93df3028..85088ae632c7 100644
--- a/src/test/regress/sql/create_property_graph.sql
+++ b/src/test/regress/sql/create_property_graph.sql
@@ -281,21 +281,30 @@ SELECT * FROM information_schema.pg_property_data_types ORDER BY property_graph_
SELECT * FROM information_schema.pg_property_graph_privileges WHERE grantee LIKE 'regress%' ORDER BY property_graph_name, grantor, grantee, privilege_type;
-- test object address functions
+CREATE TEMPORARY VIEW deps_tree AS
+ WITH RECURSIVE deps (classid, objid, objsubid, refclassid, refobjid, refobjsubid) AS (
+ SELECT classid, objid, objsubid,
+ refclassid, refobjid, refobjsubid
+ FROM pg_depend
+ WHERE refclassid = 'pg_class'::regclass AND
+ refobjid = 'create_property_graph_tests.gt'::regclass AND
+ -- eliminate this view, which is not a real dependency, from the result
+ classid <> 'pg_rewrite'::regclass
+ UNION ALL
+ SELECT d.classid, d.objid, d.objsubid,
+ d.refclassid, d.refobjid, d.refobjsubid
+ FROM pg_depend d
+ JOIN deps dp ON d.refclassid = dp.classid AND d.refobjid = dp.objid AND d.refobjsubid = dp.objsubid
+ ) SELECT DISTINCT * FROM deps;
+
SELECT pg_describe_object(classid, objid, objsubid) as obj,
- pg_describe_object(refclassid, refobjid, refobjsubid) as reference_graph
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
- ORDER BY 1, 2;
+ pg_describe_object(refclassid, refobjid, refobjsubid) as refobj
+ FROM deps_tree ORDER BY 1, 2;
SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3;
SELECT (pg_identify_object(classid, objid, objsubid)).*
- FROM pg_depend
- WHERE refclassid = 'pg_class'::regclass AND
- refobjid = 'create_property_graph_tests.g2'::regclass
+ FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3, 4;
\a\t
diff --git a/src/test/regress/sql/event_trigger.sql b/src/test/regress/sql/event_trigger.sql
index 32e9bb58c5e9..d0e6ba295fe2 100644
--- a/src/test/regress/sql/event_trigger.sql
+++ b/src/test/regress/sql/event_trigger.sql
@@ -143,6 +143,21 @@ create user mapping for regress_evt_user server useless_server;
alter default privileges for role regress_evt_user
revoke delete on tables from regress_evt_user;
+-- DROP PROPERTY GRAPH should work with event trigger in place
+CREATE TABLE tv1 (a int PRIMARY KEY, b text);
+CREATE TABLE tv2 (i int PRIMARY KEY, j text);
+CREATE TABLE te1 (p int PRIMARY KEY, a int REFERENCES tv1(a), b int REFERENCES tv2(i), q text);
+
+CREATE PROPERTY GRAPH gx
+ VERTEX TABLES (
+ tv1 LABEL l1 PROPERTIES (b AS p1),
+ tv2 LABEL l2 PROPERTIES (j AS p1))
+ EDGE TABLES (te1 SOURCE tv1 DESTINATION tv2 LABEL e1 PROPERTIES (q as p1));
+
+ALTER PROPERTY GRAPH gx ALTER EDGE TABLE te1 ALTER LABEL e1 DROP PROPERTIES (p1);
+DROP PROPERTY GRAPH gx;
+DROP TABLE tv1, tv2, te1;
+
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;
diff --git a/src/test/regress/sql/object_address.sql b/src/test/regress/sql/object_address.sql
index 1bbe9457c1ca..ed795a32e22a 100644
--- a/src/test/regress/sql/object_address.sql
+++ b/src/test/regress/sql/object_address.sql
@@ -67,7 +67,8 @@ DECLARE
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column'),
- ('property graph element'), ('property graph label'), ('property graph property')
+ ('property graph element'), ('property graph label'), ('property graph property'),
+ ('property graph element label'), ('property graph label property')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
@@ -284,6 +285,8 @@ WITH objects (classid, objid, objsubid) AS (VALUES
('pg_propgraph_element'::regclass, 0, 0), -- no property graph element
('pg_propgraph_label'::regclass, 0, 0), -- no property graph label
('pg_propgraph_property'::regclass, 0, 0), -- no property graph property
+ ('pg_propgraph_element_label'::regclass, 0, 0), -- no property graph element label
+ ('pg_propgraph_label_property'::regclass, 0, 0), -- no property graph label property
('pg_publication'::regclass, 0, 0), -- no publication
('pg_publication_namespace'::regclass, 0, 0), -- no publication namespace
('pg_publication_rel'::regclass, 0, 0), -- no publication relation
--
2.54.0
[application/pgp-signature] signature.asc (832B, ../../afvvNP8b6QEfCNsQ@paquier.xyz/3-signature.asc)
download
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
@ 2026-05-07 09:00 ` Peter Eisentraut <peter@eisentraut.org>
2026-05-07 22:06 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-02 06:57 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
1 sibling, 2 replies; 31+ messages in thread
From: Peter Eisentraut @ 2026-05-07 09:00 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; Alex Guo <guo.alex.hengchen@gmail.com>; +Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; pgsql-hackers@lists.postgresql.org
On 07.05.26 03:47, Michael Paquier wrote:
> On Wed, May 06, 2026 at 10:38:32AM +0800, Alex Guo wrote:
>> On 5/5/26 2:00 PM, Bertrand Drouvot wrote:
>>> On Thu, Apr 30, 2026 at 06:01:22PM +0530, Ashutosh Bapat wrote:
>>>> I think we should just eliminate it
>>>> from the result just like we are eliminating the rule. There is slight
>>>> convenience in keeping the query as is - it need not change even
>>>> though the columns returned by the function change and it's more
>>>> readable. I also think that we don't need a type defined for a
>>>> property graph - it doesn't contain any row as well as the shape of
>>>> the result of GRAPH_TABLE depends upon the COLUMNS clause - so that's
>>>> not fixed as well. I will start a separate thread for that
>>>> discussion.
>>>
>>> Yeah, now that 891a57c7394 is in, PFA a new version of the patch. This is just
>>> a mandatory rebase and the COLLATE "C" removals.
>
> In order to move the needle, I have applied the simplification of
> getObjectDescription() as an independent piece.
>
> Label properties lead to part descriptions like that:
> + property graph label property | | | k1 of e of e of
> create_property_graph_tests.gt
> + property graph label property | | | k2 of e of e of
> create_property_graph_tests.gt
>
> This is confusing and hard to act on for the reader, with the same
> object name defined twice (worse matter: twice in a row). For the
> reader, is the first "e" something different than the second? Do both
> refer to the same object? Do they refer to different sub-objects
> instead but named the same because the implementation dictates so?
> This could gain in clarity.
Yes, this does not seem very useful.
> This has been mentioned upthread. But, while reviewing the rest, I am
> really puzzled by your choice of "property graph element label
> property" over "property graph label property", which is inconsistent
> with the catalog description. We usually try to be careful about the
> wordings of the descriptions with the statis data in objectaddress.c,
> and the extra "element" feels out of place to me.
I think your assessment is correct. (But you still have the previous
name in the commit message.)
> I'll let Peter comment about these points, but it really looks like
> the intention of the catalog leads to a result closer to the attached
> (leaving the label property description aside for a minute).
>
> Attaching a rebased v7 with the remaining pieces.
I had left out these two catalogs from the object address handling
semi-intentionally. It's not clear to me what an event trigger would
want to do with this, or whether they should. These catalog layouts are
implementation details, and if we expose this to event triggers, are we
locked into this catalog layout? Do we need to document catalog changes
as breaking user interfaces?
Obviously, we shouldn't leave "unsupported object class" errors lying
around, but I wonder whether we could also go the other way and
intentionally skip these catalogs.
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-05-07 09:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
@ 2026-05-07 22:06 ` Michael Paquier <michael@paquier.xyz>
1 sibling, 0 replies; 31+ messages in thread
From: Michael Paquier @ 2026-05-07 22:06 UTC (permalink / raw)
To: Peter Eisentraut <peter@eisentraut.org>; +Cc: Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; pgsql-hackers@lists.postgresql.org
On Thu, May 07, 2026 at 11:00:48AM +0200, Peter Eisentraut wrote:
> (But you still have the previous name in the commit message.)
(Yes, I did not bother edit the commit message.)
> I had left out these two catalogs from the object address handling
> semi-intentionally. It's not clear to me what an event trigger would want
> to do with this, or whether they should. These catalog layouts are
> implementation details, and if we expose this to event triggers, are we
> locked into this catalog layout? Do we need to document catalog changes as
> breaking user interfaces?
>
> Obviously, we shouldn't leave "unsupported object class" errors lying
> around, but I wonder whether we could also go the other way and
> intentionally skip these catalogs.
Skipping them feels a bit weird to me as objectaddress.c acts as an
interface to make a bit readable catalog dependencies. It's true that
we are in a weird spot in this representation due to the way these two
properties are stored in the catalogs, but if we can make the text
presented to the reader less confusing that seems like a benefit to
me. You have much more context than myself here, of course, so
perhaps my impression is wrong.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../af0M_NSrfxUDkUeY@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-05-07 09:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
@ 2026-06-02 06:57 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-03 02:21 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
1 sibling, 1 reply; 31+ messages in thread
From: Ashutosh Bapat @ 2026-06-02 06:57 UTC (permalink / raw)
To: Peter Eisentraut <peter@eisentraut.org>; +Cc: Michael Paquier <michael@paquier.xyz>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On Thu, May 7, 2026 at 2:30 PM Peter Eisentraut <peter@eisentraut.org> wrote:
>
> On 07.05.26 03:47, Michael Paquier wrote:
> > On Wed, May 06, 2026 at 10:38:32AM +0800, Alex Guo wrote:
> >> On 5/5/26 2:00 PM, Bertrand Drouvot wrote:
> >>> On Thu, Apr 30, 2026 at 06:01:22PM +0530, Ashutosh Bapat wrote:
> >>>> I think we should just eliminate it
> >>>> from the result just like we are eliminating the rule. There is slight
> >>>> convenience in keeping the query as is - it need not change even
> >>>> though the columns returned by the function change and it's more
> >>>> readable. I also think that we don't need a type defined for a
> >>>> property graph - it doesn't contain any row as well as the shape of
> >>>> the result of GRAPH_TABLE depends upon the COLUMNS clause - so that's
> >>>> not fixed as well. I will start a separate thread for that
> >>>> discussion.
> >>>
> >>> Yeah, now that 891a57c7394 is in, PFA a new version of the patch. This is just
> >>> a mandatory rebase and the COLLATE "C" removals.
> >
> > In order to move the needle, I have applied the simplification of
> > getObjectDescription() as an independent piece.
> >
> > Label properties lead to part descriptions like that:
> > + property graph label property | | | k1 of e of e of
> > create_property_graph_tests.gt
> > + property graph label property | | | k2 of e of e of
> > create_property_graph_tests.gt
> >
> > This is confusing and hard to act on for the reader, with the same
> > object name defined twice (worse matter: twice in a row). For the
> > reader, is the first "e" something different than the second? Do both
> > refer to the same object? Do they refer to different sub-objects
> > instead but named the same because the implementation dictates so?
> > This could gain in clarity.
>
> Yes, this does not seem very useful.
>
> > This has been mentioned upthread. But, while reviewing the rest, I am
> > really puzzled by your choice of "property graph element label
> > property" over "property graph label property", which is inconsistent
> > with the catalog description. We usually try to be careful about the
> > wordings of the descriptions with the statis data in objectaddress.c,
> > and the extra "element" feels out of place to me.
>
> I think your assessment is correct. (But you still have the previous
> name in the commit message.)
Got it.
>
> > I'll let Peter comment about these points, but it really looks like
> > the intention of the catalog leads to a result closer to the attached
> > (leaving the label property description aside for a minute).
> >
> > Attaching a rebased v7 with the remaining pieces.
>
> I had left out these two catalogs from the object address handling
> semi-intentionally. It's not clear to me what an event trigger would
> want to do with this, or whether they should. These catalog layouts are
> implementation details, and if we expose this to event triggers, are we
> locked into this catalog layout? Do we need to document catalog changes
> as breaking user interfaces?
>
> Obviously, we shouldn't leave "unsupported object class" errors lying
> around, but I wonder whether we could also go the other way and
> intentionally skip these catalogs.
>
The objects in those two catalogs can be manipulated using ALTER
PROPERTY GRAPH ... ALTER VERTEX/EDGE TABLE ... subcommands. If an
event trigger is used to keep copies of the same property graph on
multiple different clusters (logical replicas?) in sync, they will
need to be handed over these objects.
To me your objection seems to apply to the event trigger concept
generally, not specifically for this case. If we change the layout of
any catalog that is supported by getObjectDescriptor(), the event
trigger working on that object may require a change. Isn't that true
already? FormData_pg_* structures depend upon the catalog layout, so
changes to catalog layout may break the user interface. I may be
missing something here.
--
Best Wishes,
Ashutosh Bapat
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-05-07 09:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-02 06:57 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
@ 2026-06-03 02:21 ` Michael Paquier <michael@paquier.xyz>
0 siblings, 0 replies; 31+ messages in thread
From: Michael Paquier @ 2026-06-03 02:21 UTC (permalink / raw)
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Peter Eisentraut <peter@eisentraut.org>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On Tue, Jun 02, 2026 at 12:27:19PM +0530, Ashutosh Bapat wrote:
> The objects in those two catalogs can be manipulated using ALTER
> PROPERTY GRAPH ... ALTER VERTEX/EDGE TABLE ... subcommands. If an
> event trigger is used to keep copies of the same property graph on
> multiple different clusters (logical replicas?) in sync, they will
> need to be handed over these objects.
+1. Even after re-reading the thread again, deciding to skip these
catalogs for the object descriptions still looks like an inconsistent
move compared to all the other catalogs.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../ah-PwIK3wBqh2VpU@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
@ 2026-06-05 07:10 ` Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
1 sibling, 1 reply; 31+ messages in thread
From: Peter Eisentraut @ 2026-06-05 07:10 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; Alex Guo <guo.alex.hengchen@gmail.com>; +Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; pgsql-hackers@lists.postgresql.org
On 07.05.26 03:47, Michael Paquier wrote:
> On Wed, May 06, 2026 at 10:38:32AM +0800, Alex Guo wrote:
>> On 5/5/26 2:00 PM, Bertrand Drouvot wrote:
>>> On Thu, Apr 30, 2026 at 06:01:22PM +0530, Ashutosh Bapat wrote:
>>>> I think we should just eliminate it
>>>> from the result just like we are eliminating the rule. There is slight
>>>> convenience in keeping the query as is - it need not change even
>>>> though the columns returned by the function change and it's more
>>>> readable. I also think that we don't need a type defined for a
>>>> property graph - it doesn't contain any row as well as the shape of
>>>> the result of GRAPH_TABLE depends upon the COLUMNS clause - so that's
>>>> not fixed as well. I will start a separate thread for that
>>>> discussion.
>>>
>>> Yeah, now that 891a57c7394 is in, PFA a new version of the patch. This is just
>>> a mandatory rebase and the COLLATE "C" removals.
>
> In order to move the needle, I have applied the simplification of
> getObjectDescription() as an independent piece.
>
> Label properties lead to part descriptions like that:
> + property graph label property | | | k1 of e of e of
> create_property_graph_tests.gt
> + property graph label property | | | k2 of e of e of
> create_property_graph_tests.gt
>
> This is confusing and hard to act on for the reader, with the same
> object name defined twice (worse matter: twice in a row). For the
> reader, is the first "e" something different than the second? Do both
> refer to the same object? Do they refer to different sub-objects
> instead but named the same because the implementation dictates so?
> This could gain in clarity.
>
> This has been mentioned upthread. But, while reviewing the rest, I am
> really puzzled by your choice of "property graph element label
> property" over "property graph label property", which is inconsistent
> with the catalog description. We usually try to be careful about the
> wordings of the descriptions with the statis data in objectaddress.c,
> and the extra "element" feels out of place to me.
>
> I'll let Peter comment about these points, but it really looks like
> the intention of the catalog leads to a result closer to the attached
> (leaving the label property description aside for a minute).
>
> Attaching a rebased v7 with the remaining pieces.
I have committed the v7 patch with two additional fixes: 1) Removed the
translation markers from the getObjectIdentityParts additions, these are
not supposed to be translated; and 2) added the new cases to ObjectTypeMap.
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
@ 2026-06-08 00:19 ` Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 31+ messages in thread
From: Michael Paquier @ 2026-06-08 00:19 UTC (permalink / raw)
To: Peter Eisentraut <peter@eisentraut.org>; +Cc: Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; pgsql-hackers@lists.postgresql.org
On Fri, Jun 05, 2026 at 09:10:47AM +0200, Peter Eisentraut wrote:
> I have committed the v7 patch with two additional fixes: 1) Removed the
> translation markers from the getObjectIdentityParts additions, these are not
> supposed to be translated; and 2) added the new cases to ObjectTypeMap.
+ property graph element label | | | e of e of
create_property_graph_tests.gt
+ property graph element label | | | v1 of v1 of
create_property_graph_tests.gt
+ property graph element label | | | v2 of v2 of
create_property_graph_tests.gt
[...]
+ property graph label property | | | c of e of e of
create_property_graph_tests.gt
+ property graph label property | | | k1 of e of e of
create_property_graph_tests.gt
+ property graph label property | | | k2 of e of e of
create_property_graph_tests.gt
FWIW, I still find these descriptions written as of "$object of
$object of..", or worse the "$object1 of $object2 of $object2 of..",
really hard to parse, and make some sense out of them. Am I the only
one?
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../aiYKqhUZyROUxlVs@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
@ 2026-06-08 00:28 ` Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
0 siblings, 1 reply; 31+ messages in thread
From: Tom Lane @ 2026-06-08 00:28 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; +Cc: Peter Eisentraut <peter@eisentraut.org>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; pgsql-hackers@lists.postgresql.org
Michael Paquier <michael@paquier.xyz> writes:
> + property graph element label | | | e of e of
> create_property_graph_tests.gt
> + property graph element label | | | v1 of v1 of
> create_property_graph_tests.gt
> + property graph element label | | | v2 of v2 of
> create_property_graph_tests.gt
> [...]
> + property graph label property | | | c of e of e of
> create_property_graph_tests.gt
> + property graph label property | | | k1 of e of e of
> create_property_graph_tests.gt
> + property graph label property | | | k2 of e of e of
> create_property_graph_tests.gt
> FWIW, I still find these descriptions written as of "$object of
> $object of..", or worse the "$object1 of $object2 of $object2 of..",
> really hard to parse, and make some sense out of them. Am I the only
> one?
No. At the very least, these messages violate our style guidelines [1]:
Type of the Object
When citing the name of an object, state what kind of object it is.
Rationale: Otherwise no one will know what “foo.bar.baz” refers to.
I'm not sure whether adding that would be sufficient to make these
intelligible, but surely it would help. I think your first example
would come out like
label e of property(?) e of property graph create_property_graph_tests.gt
regards, tom lane
[1] https://www.postgresql.org/docs/current/error-style-guide.html#ERROR-STYLE-GUIDE-OBJECT-TYPE
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
@ 2026-06-08 04:59 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-08 18:43 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 31+ messages in thread
From: Ashutosh Bapat @ 2026-06-08 04:59 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Michael Paquier <michael@paquier.xyz>; +Cc: Peter Eisentraut <peter@eisentraut.org>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On Mon, Jun 8, 2026 at 5:58 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Michael Paquier <michael@paquier.xyz> writes:
> > + property graph element label | | | e of e of
> > create_property_graph_tests.gt
> > + property graph element label | | | v1 of v1 of
> > create_property_graph_tests.gt
> > + property graph element label | | | v2 of v2 of
> > create_property_graph_tests.gt
> > [...]
> > + property graph label property | | | c of e of e of
> > create_property_graph_tests.gt
> > + property graph label property | | | k1 of e of e of
> > create_property_graph_tests.gt
> > + property graph label property | | | k2 of e of e of
> > create_property_graph_tests.gt
>
> > FWIW, I still find these descriptions written as of "$object of
> > $object of..", or worse the "$object1 of $object2 of $object2 of..",
> > really hard to parse, and make some sense out of them. Am I the only
> > one?
>
> No. At the very least, these messages violate our style guidelines [1]:
>
> Type of the Object
>
> When citing the name of an object, state what kind of object it is.
>
> Rationale: Otherwise no one will know what “foo.bar.baz” refers to.
>
> I'm not sure whether adding that would be sufficient to make these
> intelligible, but surely it would help. I think your first example
> would come out like
>
> label e of property(?) e of property graph create_property_graph_tests.gt
My guess is Michael and Tom are referring to two different things. I
guess, the output that Michael refers to is the value of the Identity
column from pg_identify_object() (in create_property_graph.out). I
guess what Tom is referring to is the object description in server
error messages, which uses getObjectDescription() underneath, which in
turn is also called from pg_describe_object().
create_property_graph.out has outputs from both pg_describe_object()
and pg_identify_object(). It's easy to get confused between outputs of
both when the outputs are pasted without the query which generated the
output.
pg_describe_object() correctly outputs the description as per the
documented guidelines at [1]. For example "property c of label e of
edge e of property graph gt" or "label e of edge e of property graph
gt". Tom, does that address your concern?
Let's take a look at Michael's concern now. The identity column of
pg_identity_object() ultimately comes from
getObjectIdentity()->getObjectIdentityParts(). The prologue of
getObjectIdentity() says the output is for machine consumption (so not
necessarily human consumable). The identity column should be read in
the context of the object type column of pg_identity_object(). For
example, let's consider the following lines from the output
SELECT (pg_identify_object(classid, objid, objsubid)).*
FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3, 4;
type | schema | name |
identity
-------------------------------+--------+------+-------------------------------------------------
property graph label property | | | k1 of e of e of
create_property_graph_tests.gt
property graph label property | | | k2 of e of e of
create_property_graph_tests.gt
The type of object is "property graph label property", which connects
a property to an element through a label. Hence there is only one
interpretation of the identity column i.e. "property k1/k2 of label e
of element e of property graph gt. That fits the charter of
getObjectIdentityParts(). If we do as Michael suggests we will turn
getObjectIdentityParts() into getObjectDescription(). Those two
functions have different charters Looking at
getObjectIdentityParts(), it seems that that function should produce
strings which connect objects using prepositions or adjectives instead
of explicit object types. For example, for a constraint
getObjectDescription() returns "constraint C on table R" whereas
getIndentityParts() returns "C on R". For an operator class "operator
class O for access method A" whereas getIdentityParts() returns "O
USING A". Considering these examples I think the current output of
getObjectIdentityParts() and getObjectDescription() for various
property graph components is correct. "of" is the right preposition
connecting components of a property graph. Am I missing something?
[1] https://www.postgresql.org/docs/current/error-style-guide.html#ERROR-STYLE-GUIDE-OBJECT-TYPE
--
Best Wishes,
Ashutosh Bapat
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
@ 2026-06-08 18:43 ` Tom Lane <tgl@sss.pgh.pa.us>
2026-06-10 01:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 31+ messages in thread
From: Tom Lane @ 2026-06-08 18:43 UTC (permalink / raw)
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; Peter Eisentraut <peter@eisentraut.org>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> writes:
> On Mon, Jun 8, 2026 at 5:58 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> No. At the very least, these messages violate our style guidelines [1]:
> My guess is Michael and Tom are referring to two different things. I
> guess, the output that Michael refers to is the value of the Identity
> column from pg_identify_object() (in create_property_graph.out). I
> guess what Tom is referring to is the object description in server
> error messages, which uses getObjectDescription() underneath, which in
> turn is also called from pg_describe_object().
> create_property_graph.out has outputs from both pg_describe_object()
> and pg_identify_object(). It's easy to get confused between outputs of
> both when the outputs are pasted without the query which generated the
> output.
Okay, I see that these are coming from pg_identify_object(), while
pg_describe_object() is more verbose. However, I don't think that
that ends the discussion, because existing cases in pg_identify_object
are not entirely uniform in their succinctness. You quoted some cases
that support a minimalistic style, but there are others, notably:
case AccessMethodOperatorRelationId produces
"operator %d (%s, %s) of %s"
while case AccessMethodProcedureRelationId produces
"function %d (%s, %s) of %s"
case AuthMemRelationId produces
"membership of role %s in role %s"
(hmm, this one is wrong anyway, since it then translates that string)
case UserMappingRelationId produces
"%s on server %s"
case PublicationNamespaceRelationId produces
"%s in publication %s"
as does case PublicationRelRelationId
Each of these has chosen to include an object-type name so that
people won't be totally confused about what's what. So I think
we're grading on a curve to some extent here, and it certainly
seems to me that these property-graph identifiers are confusing
enough that they deserve more than zero info about which identifier
is what. I don't think that "C on R" is terribly confusing about
the identity of a constraint, but I totally disagree that
"property graph label property" is sufficient context to disambiguate
"k2 of e of e of create_property_graph_tests.gt".
The argument that these only need to be machine-readable doesn't sway
me a lot. In the end, any code that is disassembling these strings is
going to be written by a human, and the human is a lot more likely to
make a mistake about which identifier is which if they're not labeled.
regards, tom lane
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-08 18:43 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
@ 2026-06-10 01:18 ` Michael Paquier <michael@paquier.xyz>
2026-06-10 03:58 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
0 siblings, 1 reply; 31+ messages in thread
From: Michael Paquier @ 2026-06-10 01:18 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; Peter Eisentraut <peter@eisentraut.org>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On Mon, Jun 08, 2026 at 02:43:22PM -0400, Tom Lane wrote:
> The argument that these only need to be machine-readable doesn't sway
> me a lot. In the end, any code that is disassembling these strings is
> going to be written by a human, and the human is a lot more likely to
> make a mistake about which identifier is which if they're not labeled.
+1. I'm not a robot yet and I still want to be able to parse these
strings by reading them. As things stand, this code does not allow
one to understand what each sub-object refers to. We are still in
beta, let's improve the situation.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../aii7cGhWpIR8-vcd@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-08 18:43 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-10 01:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
@ 2026-06-10 03:58 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-10 05:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 31+ messages in thread
From: Ashutosh Bapat @ 2026-06-10 03:58 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Peter Eisentraut <peter@eisentraut.org>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On Wed, Jun 10, 2026 at 6:48 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Mon, Jun 08, 2026 at 02:43:22PM -0400, Tom Lane wrote:
> > The argument that these only need to be machine-readable doesn't sway
> > me a lot. In the end, any code that is disassembling these strings is
> > going to be written by a human, and the human is a lot more likely to
> > make a mistake about which identifier is which if they're not labeled.
>
> +1. I'm not a robot yet and I still want to be able to parse these
> strings by reading them. As things stand, this code does not allow
> one to understand what each sub-object refers to. We are still in
> beta, let's improve the situation.
Here's a patch fixing it.
--
Best Wishes,
Ashutosh Bapat
Attachments:
[text/x-patch] v20260610-0008-Readable-identity-strings-for-property-gra.patch (9.1K, ../../CAExHW5uMGdnmxiiWNRNZ+PEaZfec9fVQK8hZ7Vm8vUuQwYNbcg@mail.gmail.com/2-v20260610-0008-Readable-identity-strings-for-property-gra.patch)
download | inline diff:
From a598fa1207301f822e608b4143324a1125a44685 Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Date: Wed, 10 Jun 2026 09:05:21 +0530
Subject: [PATCH v20260610 8/8] Readable identity strings for property graph
objects
The 'identity' column of pg_identify_object() for property graph objects can be
long string of names connected by 'of' e.g. "a of l of e of g". The type of the
first named object is given by column 'type'. But the types of intermediate
objects are not easy to find from the identity string especially when some of
them share the same name. Some objects like user mappings, or authorization
identifier members, add types of objects other than the first one in the
identity string. Do the same for property graph objects.
Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
---
src/backend/catalog/objectaddress.c | 10 ++--
.../expected/create_property_graph.out | 50 +++++++++----------
2 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index 33706f6de60..d5d1d41b512 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -6186,7 +6186,7 @@ getObjectIdentityParts(const ObjectAddress *object,
break;
}
pge = (Form_pg_propgraph_element) GETSTRUCT(tup);
- appendStringInfo(&buffer, "%s of ", quote_identifier(NameStr(pge->pgealias)));
+ appendStringInfo(&buffer, "%s of property graph ", quote_identifier(NameStr(pge->pgealias)));
getRelationIdentity(&buffer, pge->pgepgid, objname, false);
if (objname)
@@ -6210,7 +6210,7 @@ getObjectIdentityParts(const ObjectAddress *object,
}
pgl = (Form_pg_propgraph_label) GETSTRUCT(tup);
- appendStringInfo(&buffer, "%s of ", quote_identifier(NameStr(pgl->pgllabel)));
+ appendStringInfo(&buffer, "%s of property graph ", quote_identifier(NameStr(pgl->pgllabel)));
getRelationIdentity(&buffer, pgl->pglpgid, objname, false);
if (objname)
*objname = lappend(*objname, pstrdup(NameStr(pgl->pgllabel)));
@@ -6232,7 +6232,7 @@ getObjectIdentityParts(const ObjectAddress *object,
}
pgp = (Form_pg_propgraph_property) GETSTRUCT(tup);
- appendStringInfo(&buffer, "%s of ", quote_identifier(NameStr(pgp->pgpname)));
+ appendStringInfo(&buffer, "%s of property graph ", quote_identifier(NameStr(pgp->pgpname)));
getRelationIdentity(&buffer, pgp->pgppgid, objname, false);
if (objname)
*objname = lappend(*objname, pstrdup(NameStr(pgp->pgpname)));
@@ -6265,7 +6265,7 @@ getObjectIdentityParts(const ObjectAddress *object,
pgelform = (Form_pg_propgraph_element_label) GETSTRUCT(tup);
labelname = get_propgraph_label_name(pgelform->pgellabelid);
- appendStringInfo(&buffer, "%s of ", quote_identifier(labelname));
+ appendStringInfo(&buffer, "%s of element ", quote_identifier(labelname));
ObjectAddressSet(oa, PropgraphElementRelationId, pgelform->pgelelid);
appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
objargs, false));
@@ -6303,7 +6303,7 @@ getObjectIdentityParts(const ObjectAddress *object,
plpform = (Form_pg_propgraph_label_property) GETSTRUCT(tup);
propname = get_propgraph_property_name(plpform->plppropid);
- appendStringInfo(&buffer, "%s of ", quote_identifier(propname));
+ appendStringInfo(&buffer, "%s of label ", quote_identifier(propname));
ObjectAddressSet(oa, PropgraphElementLabelRelationId, plpform->plpellabelid);
appendStringInfoString(&buffer, getObjectIdentityParts(&oa, objname,
objargs, false));
diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out
index f9d17aeb34a..1e733f9b572 100644
--- a/src/test/regress/expected/create_property_graph.out
+++ b/src/test/regress/expected/create_property_graph.out
@@ -759,31 +759,31 @@ SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
SELECT (pg_identify_object(classid, objid, objsubid)).*
FROM (SELECT DISTINCT classid, objid, objsubid FROM deps_tree)
ORDER BY 1, 2, 3, 4;
- type | schema | name | identity
--------------------------------+--------+------+-------------------------------------------------
- property graph element | | | e of create_property_graph_tests.gt
- property graph element | | | v1 of create_property_graph_tests.gt
- property graph element | | | v2 of create_property_graph_tests.gt
- property graph element label | | | e of e of create_property_graph_tests.gt
- property graph element label | | | v1 of v1 of create_property_graph_tests.gt
- property graph element label | | | v2 of v2 of create_property_graph_tests.gt
- property graph label | | | e of create_property_graph_tests.gt
- property graph label | | | v1 of create_property_graph_tests.gt
- property graph label | | | v2 of create_property_graph_tests.gt
- property graph label property | | | a of v1 of v1 of create_property_graph_tests.gt
- property graph label property | | | b of v1 of v1 of create_property_graph_tests.gt
- property graph label property | | | c of e of e of create_property_graph_tests.gt
- property graph label property | | | k1 of e of e of create_property_graph_tests.gt
- property graph label property | | | k2 of e of e of create_property_graph_tests.gt
- property graph label property | | | m of v2 of v2 of create_property_graph_tests.gt
- property graph label property | | | n of v2 of v2 of create_property_graph_tests.gt
- property graph property | | | a of create_property_graph_tests.gt
- property graph property | | | b of create_property_graph_tests.gt
- property graph property | | | c of create_property_graph_tests.gt
- property graph property | | | k1 of create_property_graph_tests.gt
- property graph property | | | k2 of create_property_graph_tests.gt
- property graph property | | | m of create_property_graph_tests.gt
- property graph property | | | n of create_property_graph_tests.gt
+ type | schema | name | identity
+-------------------------------+--------+------+------------------------------------------------------------------------------
+ property graph element | | | e of property graph create_property_graph_tests.gt
+ property graph element | | | v1 of property graph create_property_graph_tests.gt
+ property graph element | | | v2 of property graph create_property_graph_tests.gt
+ property graph element label | | | e of element e of property graph create_property_graph_tests.gt
+ property graph element label | | | v1 of element v1 of property graph create_property_graph_tests.gt
+ property graph element label | | | v2 of element v2 of property graph create_property_graph_tests.gt
+ property graph label | | | e of property graph create_property_graph_tests.gt
+ property graph label | | | v1 of property graph create_property_graph_tests.gt
+ property graph label | | | v2 of property graph create_property_graph_tests.gt
+ property graph label property | | | a of label v1 of element v1 of property graph create_property_graph_tests.gt
+ property graph label property | | | b of label v1 of element v1 of property graph create_property_graph_tests.gt
+ property graph label property | | | c of label e of element e of property graph create_property_graph_tests.gt
+ property graph label property | | | k1 of label e of element e of property graph create_property_graph_tests.gt
+ property graph label property | | | k2 of label e of element e of property graph create_property_graph_tests.gt
+ property graph label property | | | m of label v2 of element v2 of property graph create_property_graph_tests.gt
+ property graph label property | | | n of label v2 of element v2 of property graph create_property_graph_tests.gt
+ property graph property | | | a of property graph create_property_graph_tests.gt
+ property graph property | | | b of property graph create_property_graph_tests.gt
+ property graph property | | | c of property graph create_property_graph_tests.gt
+ property graph property | | | k1 of property graph create_property_graph_tests.gt
+ property graph property | | | k2 of property graph create_property_graph_tests.gt
+ property graph property | | | m of property graph create_property_graph_tests.gt
+ property graph property | | | n of property graph create_property_graph_tests.gt
(23 rows)
\a\t
--
2.34.1
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-08 18:43 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-10 01:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 03:58 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
@ 2026-06-10 05:19 ` Michael Paquier <michael@paquier.xyz>
2026-06-10 11:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
0 siblings, 1 reply; 31+ messages in thread
From: Michael Paquier @ 2026-06-10 05:19 UTC (permalink / raw)
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Peter Eisentraut <peter@eisentraut.org>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On Wed, Jun 10, 2026 at 09:28:56AM +0530, Ashutosh Bapat wrote:
> Here's a patch fixing it.
Based on the definitions of pglpgid/pgepgid/pgppgid (property graph
relations), pgelelid (property graph element) and plpellabelid
(property graph element label), that looks better. I am still puzzled
regarding the choice of "label" in the patch for plpellabelid while it
is an "element label" based on the way it is stored in its catalog,
with the catalog matching the object being named "property graph
element label".
There may be a point in suffixing all these objects with a set of
"property graph" strings, but perhaps you are right in limiting the
length of the output without these. Talking about "element" and
"element label" (not "label"!) would be good enough here.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../aijzu0Wsv736_NuS@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-08 18:43 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-10 01:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 03:58 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-10 05:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
@ 2026-06-10 11:00 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-17 05:14 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 31+ messages in thread
From: Ashutosh Bapat @ 2026-06-10 11:00 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Peter Eisentraut <peter@eisentraut.org>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On Wed, Jun 10, 2026 at 10:49 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Wed, Jun 10, 2026 at 09:28:56AM +0530, Ashutosh Bapat wrote:
> > Here's a patch fixing it.
>
> Based on the definitions of pglpgid/pgepgid/pgppgid (property graph
> relations), pgelelid (property graph element) and plpellabelid
> (property graph element label), that looks better. I am still puzzled
> regarding the choice of "label" in the patch for plpellabelid while it
> is an "element label" based on the way it is stored in its catalog,
> with the catalog matching the object being named "property graph
> element label".
>
Which specific string you are referring to?
property graph element label | | | e of element e of
property graph create_property_graph_tests.gt - that doesn't have a
bare label in there
probably the next one
property graph label property | | | a of label v1 of
element v1 of property graph create_property_graph_tests.gt
The term "element" comes later "label v1 of element v1". There's
nothing in the standard called "element label". That term is an
artifact of our implementation. I think "label v1 of element v1" reads
better and follows the standard compared to "element label v1 of
element v1".
There's also a precedent of not using exact catalog names. In case of
user mapping we say " %s of server ...", we don't use "foreign server"
there even though the object is called "foreign server" and the
catalog is pg_foreign_server.
--
Best Wishes,
Ashutosh Bapat
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-08 18:43 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-10 01:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 03:58 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-10 05:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 11:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
@ 2026-06-17 05:14 ` Michael Paquier <michael@paquier.xyz>
2026-06-18 05:41 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
0 siblings, 1 reply; 31+ messages in thread
From: Michael Paquier @ 2026-06-17 05:14 UTC (permalink / raw)
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Peter Eisentraut <peter@eisentraut.org>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On Wed, Jun 10, 2026 at 04:30:24PM +0530, Ashutosh Bapat wrote:
> The term "element" comes later "label v1 of element v1". There's
> nothing in the standard called "element label". That term is an
> artifact of our implementation. I think "label v1 of element v1" reads
> better and follows the standard compared to "element label v1 of
> element v1".
[ ... checks 9075-16-2023 ... ]
The term is "element table label" when referring to a clause, and most
of the places refer to only "label", so I guess that I'm fine with
your wording here.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../ajItSKjvadWQKKaY@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-08 18:43 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-10 01:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 03:58 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-10 05:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 11:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-17 05:14 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
@ 2026-06-18 05:41 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-18 06:06 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 31+ messages in thread
From: Ashutosh Bapat @ 2026-06-18 05:41 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Peter Eisentraut <peter@eisentraut.org>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On Wed, Jun 17, 2026 at 10:44 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Wed, Jun 10, 2026 at 04:30:24PM +0530, Ashutosh Bapat wrote:
> > The term "element" comes later "label v1 of element v1". There's
> > nothing in the standard called "element label". That term is an
> > artifact of our implementation. I think "label v1 of element v1" reads
> > better and follows the standard compared to "element label v1 of
> > element v1".
>
> [ ... checks 9075-16-2023 ... ]
>
> The term is "element table label" when referring to a clause, and most
> of the places refer to only "label", so I guess that I'm fine with
> your wording here.
> --
> Michael
Thanks for the confirmation.
Since the original bug, which led to creating a PG 19 open item, is
fixed I am moving the open item to the resolved section.
IIUC, the follow-on discussion seems to have concluded and Michael is
fine with the last version of patch. It feels like we need to commit
that patch. Michael, are you going to commit it or do you expect
somebody else to do it?
--
Best Wishes,
Ashutosh Bapat
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-08 18:43 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-10 01:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 03:58 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-10 05:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 11:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-17 05:14 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-18 05:41 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
@ 2026-06-18 06:06 ` Michael Paquier <michael@paquier.xyz>
2026-06-23 07:23 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
0 siblings, 1 reply; 31+ messages in thread
From: Michael Paquier @ 2026-06-18 06:06 UTC (permalink / raw)
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Peter Eisentraut <peter@eisentraut.org>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On Thu, Jun 18, 2026 at 11:11:31AM +0530, Ashutosh Bapat wrote:
> IIUC, the follow-on discussion seems to have concluded and Michael is
> fine with the last version of patch. It feels like we need to commit
> that patch. Michael, are you going to commit it or do you expect
> somebody else to do it?
I was waiting for Peter E. to show up as the committer owning this
code, for comments. Now, I don't mind chiming in if I don't hear back
from him by the beginning of next week.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../ajOKzLCBvIeuOBYu@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-08 18:43 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-10 01:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 03:58 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-10 05:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 11:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-17 05:14 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-18 05:41 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-18 06:06 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
@ 2026-06-23 07:23 ` Peter Eisentraut <peter@eisentraut.org>
2026-06-23 07:25 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 31+ messages in thread
From: Peter Eisentraut @ 2026-06-23 07:23 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On 18.06.26 08:06, Michael Paquier wrote:
> On Thu, Jun 18, 2026 at 11:11:31AM +0530, Ashutosh Bapat wrote:
>> IIUC, the follow-on discussion seems to have concluded and Michael is
>> fine with the last version of patch. It feels like we need to commit
>> that patch. Michael, are you going to commit it or do you expect
>> somebody else to do it?
>
> I was waiting for Peter E. to show up as the committer owning this
> code, for comments. Now, I don't mind chiming in if I don't hear back
> from him by the beginning of next week.
I have committed it now.
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-08 18:43 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Tom Lane <tgl@sss.pgh.pa.us>
2026-06-10 01:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 03:58 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-10 05:19 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-10 11:00 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-17 05:14 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-18 05:41 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-18 06:06 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-06-23 07:23 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Peter Eisentraut <peter@eisentraut.org>
@ 2026-06-23 07:25 ` Michael Paquier <michael@paquier.xyz>
0 siblings, 0 replies; 31+ messages in thread
From: Michael Paquier @ 2026-06-23 07:25 UTC (permalink / raw)
To: Peter Eisentraut <peter@eisentraut.org>; +Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; Alex Guo <guo.alex.hengchen@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org
On Tue, Jun 23, 2026 at 09:23:12AM +0200, Peter Eisentraut wrote:
> I have committed it now.
Thanks!
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../ajo01L9SfubMSy_d@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 31+ messages in thread
* Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Re: Fix DROP PROPERTY GRAPH "unsupported object class" error Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
@ 2026-05-06 23:22 ` Michael Paquier <michael@paquier.xyz>
1 sibling, 0 replies; 31+ messages in thread
From: Michael Paquier @ 2026-05-06 23:22 UTC (permalink / raw)
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; +Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter@eisentraut.org>
On Thu, Apr 30, 2026 at 06:01:22PM +0530, Ashutosh Bapat wrote:
> I was planning to start a separate discussion to change all catalog
> lookups in those functions to use get_catalog_object_by_oid(), hence
> didn't include changes in getObjectDescription(). But I am fine if we
> want to do it in this patch just for the property graph related nodes.
It does not strike me as a big deal to use get_catalog_object_by_oid
for PropgraphLabelPropertyRelationId, not does it strike me as a big
deal to keep the code as is as this is new code. Changing the other
object types to use get_catalog_object_by_oid() is going overboard as
it is not directly related to the issue at hand, so a separate
discussion looks adapted. I do agree that it would be a good move to
reuse get_catalog_object_by_oid() when we can: a syscache scan (or if
one is added in the future) will be always cheaper than a systable
scan.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../afvNSY494C5qxhfd@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 31+ messages in thread
end of thread, other threads:[~2026-06-23 07:25 UTC | newest]
Thread overview: 31+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-22 16:19 Fix DROP PROPERTY GRAPH "unsupported object class" error Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-23 06:39 ` Michael Paquier <michael@paquier.xyz>
2026-04-23 07:27 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-23 11:01 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-24 12:07 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-24 14:18 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-29 12:32 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-04-30 11:26 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-04-30 12:31 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-05-05 06:00 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-05-06 02:38 ` Alex Guo <guo.alex.hengchen@gmail.com>
2026-05-07 01:47 ` Michael Paquier <michael@paquier.xyz>
2026-05-07 09:00 ` Peter Eisentraut <peter@eisentraut.org>
2026-05-07 22:06 ` Michael Paquier <michael@paquier.xyz>
2026-06-02 06:57 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-03 02:21 ` Michael Paquier <michael@paquier.xyz>
2026-06-05 07:10 ` Peter Eisentraut <peter@eisentraut.org>
2026-06-08 00:19 ` Michael Paquier <michael@paquier.xyz>
2026-06-08 00:28 ` Tom Lane <tgl@sss.pgh.pa.us>
2026-06-08 04:59 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-08 18:43 ` Tom Lane <tgl@sss.pgh.pa.us>
2026-06-10 01:18 ` Michael Paquier <michael@paquier.xyz>
2026-06-10 03:58 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-10 05:19 ` Michael Paquier <michael@paquier.xyz>
2026-06-10 11:00 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-17 05:14 ` Michael Paquier <michael@paquier.xyz>
2026-06-18 05:41 ` Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
2026-06-18 06:06 ` Michael Paquier <michael@paquier.xyz>
2026-06-23 07:23 ` Peter Eisentraut <peter@eisentraut.org>
2026-06-23 07:25 ` Michael Paquier <michael@paquier.xyz>
2026-05-06 23:22 ` Michael Paquier <michael@paquier.xyz>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox