]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Prevent dropping the last label from a property graph element
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 3 Jul 2026 09:52:42 +0000 (11:52 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 3 Jul 2026 10:10:31 +0000 (12:10 +0200)
commit7afa11feca6c4e48d01890580564d55cf226fe02
treeb0f1c7bf8648a5a5bc1c382658390a071336434c
parent617c7574055009fc6678a0f17bc9160d94e58607
Prevent dropping the last label from a property graph element

Per SQL/PGQ standard, every graph element must have at least one
label.  When dropping a label from a graph element, ensure that there
exists at least one other label on the element.  If the label being
dropped is the only label on the element, raise an error.

We hold a ShareRowExclusiveLock when modifying a property graph.
Hence the label will not be dropped even when multiple labels are
being dropped concurrently.

Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Author: Satyanarayana Narlapuram <satyanarlapuram@gmail.com>
Reported-by: Satyanarayana Narlapuram <satyanarlapuram@gmail.com>
Discussion: https://www.postgresql.org/message-id/CAHg+QDeP=mTHTV48R23zKMy1SBmCKZ_L7-z5zKnYyw+K0x-gCg@mail.gmail.com
doc/src/sgml/ref/alter_property_graph.sgml
src/backend/commands/propgraphcmds.c
src/test/regress/expected/create_property_graph.out
src/test/regress/sql/create_property_graph.sql