Fix DROP PROPERTY GRAPH "unsupported object class" error

Bertrand Drouvot <bertranddrouvot.pg@gmail.com>

From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Cc: Peter Eisentraut <peter@eisentraut.org>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Date: 2026-04-22T16:19:26Z
Lists: pgsql-hackers

Attachments

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

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Readable identity strings for property graph objects

  2. Handle element label and label property objects in object address functions

  3. Simplify code in objectaddress.c for some property graph objects