pgsql: Fix handling of dropping a property not associated with the give

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix handling of dropping a property not associated with the give
Date: 2026-07-03 14:39:39
Message-ID: E1wff3L-001Aze-0p@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix handling of dropping a property not associated with the given label

When dropping a property by name from a label, the code checked only
whether the property existed in the graph's property catalog. It did
not verify that the property was actually associated with the given
label, resulting in passing InvalidOid to performDeletion(). Fix it
by explicilty checking the label property association.

While at it also rearrange the code so as to avoid multiple ereport
calls for the same error in the same block.

Author: Chao Li <lic(at)highgo(dot)com>
Reviewed-by: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/1DA5D52A-4AFA-426E-83F7-42ED974D682B%40gmail.com

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/36aae3d0297d35602dec40ca3edbaf82320a4cc7

Modified Files
--------------
src/backend/commands/propgraphcmds.c | 47 +++++++++-------------
.../regress/expected/create_property_graph.out | 2 +
src/test/regress/sql/create_property_graph.sql | 1 +
3 files changed, 22 insertions(+), 28 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alexander Korotkov 2026-07-03 15:01:36 pgsql: Prevent access to other sessions' empty temp tables
Previous Message Heikki Linnakangas 2026-07-03 12:05:58 pgsql: Fix tracing of BackendKeyData and CancelRequest