Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wMc1s-000De2-2s for pgsql-hackers@arkaria.postgresql.org; Tue, 12 May 2026 01:35:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wMc1r-002oRt-0l for pgsql-hackers@arkaria.postgresql.org; Tue, 12 May 2026 01:35:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wMc1q-002oRl-33 for pgsql-hackers@lists.postgresql.org; Tue, 12 May 2026 01:35:23 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wMc1o-000000008nL-3Sp5 for pgsql-hackers@lists.postgresql.org; Tue, 12 May 2026 01:35:22 +0000 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-44c350a5b87so3007526f8f.3 for ; Mon, 11 May 2026 18:35:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1778549720; cv=none; d=google.com; s=arc-20240605; b=K0KhTUvTxdM7CzF10W1WeDZrOfKucZ8+NcIxW7BR7xaKjb0jqEzGDHgKloR1Q1bTTF HRxR/yiNlTs7OM/SnSrKFMIeVEqTY/HdYlKTE3Rhdw29DdZjpYTgxYyJnVekaXbpTuLB F2w1xf7UmHEl11t+x/nKFDUXZl5XK+tdDhbviSEYS6duAtGdusNv4FschkOJYtJrGUec +nhhCIV2XRnhzNdrhaEszktAumMq9PvTN7pFWY9xPhzgrtkYadQWbi7Fz0KjPpL5tWRS eykyYLoAY/WJIyuX9p3D9+j2UMm5omIUGHbiaeJ3zYuJ/X00qb3mFupbv50B8dJc3wvR fDmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XiXwLpqHErWBoqjtPxTBMG5aFwthT6MXsVjAYvnWDeU=; fh=GE7o2yZ6JLYdYycUTyWhYXv8ke283VzaUME8z5fJR9Q=; b=SRtyuOkLFl2pylT8aQ3bF6wj7dfctji5FBl97DY+W2sIqy927PJsN1jnXT6X3g+RE/ pwlBub4/VCs8miygcsi3/s1sFiNqCK7QavOayyOG41ELksXLf8c7Yv+dcYoCmPdWYLDS IhD7L4SVb/OZv8xXElv6ROE/+75uE3fj6pk2GvT+2BQdaomEflZImtcLfP8bSB45vQ/Y yB8vmUgT3lcmUVEdwPbuyR3a+bHNkwlJqYy1KCvePnZ0ag92YKoucLN027IL/PvC6CsR EY8LYUYo9KKrulFx1j1g6BW4/KRdPyCZfJ1sHi4r1guZdq6iLsz9kUuvaEGdWv9NZpJx nLlw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778549720; x=1779154520; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XiXwLpqHErWBoqjtPxTBMG5aFwthT6MXsVjAYvnWDeU=; b=lePTaOqb/ql6SfXYyJNwlPBIiP6sCPTOsdSKtD6v1Md0z1PL+AzWkILQcpd8FWCkqT dWZjpzsog5T7TlZSdNrlksvPkYV8ToJtfueQQ0DIW+dRySrEldzVJ4d0o5FQVFER+3Vp taVZFuxW656+HoP2EzarENwkJTXSFd/0wnkwCQYO7fGUJ6uKSAU2+1k7oNO7YS3fghlx KCCVOHGxad4WVFsBNuE3Ecqvdf1q2iJ2z9xGZnBAEtA4QmZbogbH5KlMKQ0zoRvE4z0u 1boD74+VLFGiW3v96GsjTefjZckQkNcHjiCyUsBU2nf67KnjHi/T1A1NwN6C8Vskonsq Wwlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778549720; x=1779154520; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XiXwLpqHErWBoqjtPxTBMG5aFwthT6MXsVjAYvnWDeU=; b=Dx2TvJlX5F9KZknxYVB/G5vK0gmdBYupXB75XUlQkB/j/5wPtu1Io7I6F8JpPFCQur IxcUNNTpIJq6OohoV5ajIZPwL2NJ/EGTKmMve4rkJCqZmJR0WX//Ta66gW134z0T2p+L oOlI6/M8nZ0g/6FmPI6HGgze812U4HMXVr9iHl6uYnQFDrO9VJzjjf8R71+Wb8CuoVY/ jNYysMoFEsxvkzOo51+EU9r0azb20DJ1pbta9iSm7a6FvEggtJk16OVqRKt1HpHIN5KV oo4PSl5qsGKKjAjq8UVgU0DfhRrVSHfUsD8SFuNN2VoUrHgHuKZmmCubuzCbuV6pEpYb 5VAw== X-Forwarded-Encrypted: i=1; AFNElJ/nHSxL1BPGtH6YeQDu3Jo/Jravy1H+XP7jYLRyTLqwnz18DhWxYPKjZXV7SF0tFWeLqAbKJKg6ojB3b44S@lists.postgresql.org X-Gm-Message-State: AOJu0Yz9vA2LBdr9ZK7eCF6fZHEq3dokfvlXw2BbdLOjlfPLbCgfqY0d qAsMOQQ081l5xzUz0gBxeiMMboYC5OEfKnQHxQxhTLjfKzdyRe1LxZYIaMfipq/e6CGWvIoR2ZC 7TPKvgI3KAJktSXTw+CvpCpWzt4Wx9JI= X-Gm-Gg: Acq92OFQfYltOJu8nUvosPZ+pg7+8MMDUHCpB1Hh6QnrgVqZMd5rM5SDQdiL6hn9MVW FhHB+Irw4vutwMTjQj1xli0kMRkDEkgyhOppVODDUpVbQXIN10Bywn5DJOz5DVrmZd4Jkgm4pe+ t/CRNqa2gAlD0uRzohTcix/iEb3i4DKkR1SPYSiZ7CeWqbkjf02j/sXyacvNEmLDvEeAbW3asDE UsjosanaqK5rx4XKAP/5LdAtk2mMn2He33YX/EDYMyLBBPAMWL7E4Y6p1NWPMbf/T+kOJmv80aD 8b/nZXRS5ogeFCWXcRFbDceCbsyAxiKn/ZKsUru3h7cRYWUgnb+d X-Received: by 2002:a5d:64c7:0:b0:44a:fa76:5193 with SMTP id ffacd0b85a97d-45b12fd25camr730125f8f.12.1778549719441; Mon, 11 May 2026 18:35:19 -0700 (PDT) MIME-Version: 1.0 References: <3762a2e0-d3be-40e7-83d2-52dc3e1a21b2@eisentraut.org> In-Reply-To: <3762a2e0-d3be-40e7-83d2-52dc3e1a21b2@eisentraut.org> From: Ashutosh Bapat Date: Tue, 12 May 2026 07:05:06 +0530 X-Gm-Features: AVHnY4KUX2itSf2TOmjDJqaHg6x6dUsefMC6uu9suvREB0qJjnpBSJiwS3nwYYM Message-ID: Subject: Re: [Bug][patch]: After dropping the last label from a property graph element, invoking pg_get_propgraphdef() triggers an assertion failure To: Peter Eisentraut Cc: SATYANARAYANA NARLAPURAM , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, May 4, 2026 at 8:16=E2=80=AFPM Peter Eisentraut wrote: > > On 28.04.26 17:02, Ashutosh Bapat wrote: > > We are looking up element label catalogs twice in this patch - first > > to find the label to be dropped and then to find the number of labels > > associated with the given element. I combined these two into a single > > while loop. > > That looks okay, but I think the names of the local variables are now a > bit off. I would expect elrel and elscan to refer to > pg_propgraph_element, not pg_propgraph_element_label. Maybe use > ellabelrel etc. Done. > > Also, I think this code needs to think a bit about locking to handle the > situation where more than one DROP LABEL operation happens concurrently. > AlterPropGraph already takes ShareRowExclusiveLock at the beginning so only one label can be dropped at a time. I have added an isolation test to test the scenario. We could further add some more tests to make sure that properties can not be added to a label being dropped, adding label to an element being dropped, adding label to an element being added etc. Would that be an overkill? --=20 Best Wishes, Ashutosh Bapat