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 1vqbrh-00EICN-1i for pgsql-general@arkaria.postgresql.org; Thu, 12 Feb 2026 18:56:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vqbrg-00AUTR-2T for pgsql-general@arkaria.postgresql.org; Thu, 12 Feb 2026 18:56:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vqbrg-00AUTJ-18 for pgsql-general@lists.postgresql.org; Thu, 12 Feb 2026 18:56:37 +0000 Received: from mout01.posteo.de ([185.67.36.65]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vqbrd-00000000KTR-3eRa for pgsql-general@postgresql.org; Thu, 12 Feb 2026 18:56:36 +0000 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 84C45240028 for ; Thu, 12 Feb 2026 19:56:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.de; s=2017; t=1770922590; bh=sfQex6FGKOnCTkBfkBcZdwPfsHmeLi0EGO/jId0k7qY=; h=Content-Type:Message-ID:Date:MIME-Version:Subject:To:Cc:From: From; b=JifmxlmkvIy/EaXruHZfRdz0FSdVyLoUjwbucIgYUi+PqK956Jo18NGfy1x7iO+CF dcl91++3C+0iOcUc0iHv9VLfPKjk3AocrZsbkNzo0GuiSIC7IJqgLs0EuhF2WvXAB6 aJ5z4osTUAhT4QyP8lx/cDezc8zD+L2JY8MLiwGC1bo0Z1k0QyKT1rLiclTYXG2Ozb CW27hDmQ8iIwvrXkSpJwQ6T3Hef8Dro8GXjIlJjHrP/rStWFdEkyML8zsBaDpR9MBm q/HSnWyYLoawusQBd5MOKSjpr8ZITWCV/QrDGFVIGJQmRa23biqJitkaSjFAllJxwO eqHmNhVROrgmQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4fBkzc0d15z6tvq; Thu, 12 Feb 2026 19:56:28 +0100 (CET) Content-Type: multipart/alternative; boundary="------------oeqHtbFS5gqs463Hkmu8dEtu" Message-ID: <71f6fa8c-de7b-4af0-a952-1bd4db4e3007@posteo.de> Date: Thu, 12 Feb 2026 18:56:30 +0000 MIME-Version: 1.0 Subject: Re: Guarantee order of batched pg_advisory_xact_lock To: Greg Sabino Mullane Cc: Tom Lane , pgsql-general@postgresql.org References: <93fb937f-9f4d-4bd7-b7e6-51d5f98859d9@posteo.de> <14506.1770844674@sss.pgh.pa.us> <101916.1770850197@sss.pgh.pa.us> <777cfa1c-fd1f-479f-b9b8-217b0f7a40b7@posteo.de> Content-Language: en-US From: Nico Heller In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------oeqHtbFS5gqs463Hkmu8dEtu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit For my case that is not true as our keys are globally unique URN strings. Thus, only the hashes may collide, but thank you for the insight. On 2/12/26 15:47, Greg Sabino Mullane wrote: > On Thu, Feb 12, 2026 at 6:18 AM Nico Heller wrote: > > I just checked for hash collisions with the following query today: > > SELECT COUNT(*), hashtextextended(key, 0) FROM > ( >   SELECT key FROM table1 >   UNION > > FWIW, you need UNION ALL, not UNION, if you are trying to detect > duplicate values (hashed or not) across tables. > > Cheers, > Greg > --------------oeqHtbFS5gqs463Hkmu8dEtu Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

For my case that is not true as our keys are globally unique URN strings. Thus, only the hashes may collide, but thank you for the insight.

On 2/12/26 15:47, Greg Sabino Mullane wrote:
On Thu, Feb 12, 2026 at 6:18 AM Nico Heller <nico.heller@posteo.de> wrote:

I just checked for hash collisions with the following query today:

SELECT COUNT(*), hashtextextended(key, 0) FROM
(
  SELECT key FROM table1
  UNION 

 
FWIW, you need UNION ALL, not UNION, if you are trying to detect duplicate values (hashed or not) across tables.

Cheers,
Greg

--------------oeqHtbFS5gqs463Hkmu8dEtu--