pgsql: Prevent dropping the last label from a property graph element

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Prevent dropping the last label from a property graph element
Date: 2026-07-03 10:17:50
Message-ID: E1wfaxy-0019gh-1H@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)bapat(dot)oss(at)gmail(dot)com>
Author: Satyanarayana Narlapuram <satyanarlapuram(at)gmail(dot)com>
Reported-by: Satyanarayana Narlapuram <satyanarlapuram(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/CAHg+QDeP=mTHTV48R23zKMy1SBmCKZ_L7-z5zKnYyw+K0x-gCg@mail.gmail.com

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ac0ad6a7c9d1f7c0d82696260fdcb2d09a8962c1

Modified Files
--------------
doc/src/sgml/ref/alter_property_graph.sgml | 4 +-
src/backend/commands/propgraphcmds.c | 55 ++++++++++++++++++++--
.../regress/expected/create_property_graph.out | 7 +++
src/test/regress/sql/create_property_graph.sql | 5 ++
4 files changed, 65 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Álvaro Herrera 2026-07-03 10:23:44 pgsql: Fix REPACK CONCURRENTLY for stored generated columns
Previous Message Amit Kapila 2026-07-03 08:40:33 pgsql: Add commit fdad19e1cf to .git-blame-ignore-revs.