Re: Fix DROP PROPERTY GRAPH "unsupported object class" error

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Alex Guo <guo(dot)alex(dot)hengchen(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
Date: 2026-06-08 04:59:09
Message-ID: CAExHW5sR8tY1JBoG4MGH3pU9A5wq1m4mHZOt0c8wXjcVqZ13sw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 8, 2026 at 5:58 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Michael Paquier <michael(at)paquier(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Hayato Kuroda (Fujitsu) 2026-06-08 04:25:45 RE: t/035_standby_logical_decoding.pl might fail on attempt to read wrong timeline