Re: Guarantee order of batched pg_advisory_xact_lock - Mailing list pgsql-general

From Greg Sabino Mullane
Subject Re: Guarantee order of batched pg_advisory_xact_lock
Date
Msg-id CAKAnmmJoX=KJyH2g8tWtbSoqJp7nnyeBChaLgF6bbGv1zGLzwg@mail.gmail.com
Whole thread
In response to Re: Guarantee order of batched pg_advisory_xact_lock  (Nico Heller <nico.heller@posteo.de>)
Responses Re: Guarantee order of batched pg_advisory_xact_lock
List pgsql-general
On Mon, Feb 16, 2026 at 12:45 PM Nico Heller <nico.heller@posteo.de> wrote:

Does anyone have any idea what the root cause of my issue is? I appreciate any insight.
As I said, hash collisions can be rules out, sadly.


Well, you could set log_statement to 'all' for a bit to see *exactly* what each of the deadlocking processes are doing. Alternatively, perhaps you can write a hashextendedkey() function that outputs arguments and results to a log and/or a table.

keysToLock is a text[] parameter which is pre-sorted in our application

Would not hurt to triple-check this part as well. Could show us the app code? Maybe put in some sort of global assert in the app to verify that things are indeed sorted as you think they are.


Cheers,
Greg

--
Enterprise Postgres Software Products & Tech Support

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Where the info is stored
Next
From: Greg Sabino Mullane
Date:
Subject: Re: Where the info is stored