]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix handling of dropping a property not associated with the given label
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 3 Jul 2026 14:06:29 +0000 (16:06 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 3 Jul 2026 14:29:37 +0000 (16:29 +0200)
commit36aae3d0297d35602dec40ca3edbaf82320a4cc7
tree479d758ca63a0bc8f4ac3753d536f1d01c63936d
parent0766bc57e9f94e5321e6ea4cb49db430224b2e60
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@highgo.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/1DA5D52A-4AFA-426E-83F7-42ED974D682B%40gmail.com
src/backend/commands/propgraphcmds.c
src/test/regress/expected/create_property_graph.out
src/test/regress/sql/create_property_graph.sql