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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Peter Eisentraut <peter(at)eisentraut(dot)org>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Subject: Re: Fix DROP PROPERTY GRAPH "unsupported object class" error
Date: 2026-04-23 06:39:34
Message-ID: aem-pjK57peuLI-x@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-04-23 06:45:06 Re: Question about criteria for adding items to the v19 open items wiki page
Previous Message Chao Li 2026-04-23 06:34:03 Re: Cleanup shadows variable warnings, round 1