SELECT .. FOR UPDATE: find out who locked a row

From: "Enrico Thierbach" <eno(at)open-lab(dot)org>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: SELECT .. FOR UPDATE: find out who locked a row
Date: 2018-03-15 20:30:28
Message-ID: E269BF34-4CE1-47EC-8A80-F18DE55E2BEF@open-lab.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I am using `SELECT * FROM queue ... FOR UPDATE SKIP LOCKED` to implement
a queueing system.

Now I wonder if it is possible, given the id of one of the locked rows
in the queue table, to find out which connection/which transaction owns
the lock.

Any help is greatly appreciated.

Thank you,
/eno

--
me at github: https://github.com/radiospiel
me at linked.in: https://www.linkedin.com/in/radiospiel

Responses

Browse pgsql-general by date

  From Date Subject
Next Message pinker 2018-03-15 20:36:14 Re: SELECT .. FOR UPDATE: find out who locked a row
Previous Message Raghavendra Rao J S V 2018-03-15 18:55:47 ERROR: right sibling's left-link doesn't match: block 5 links to 8 instead of expected 2 in index "pg_toast_2619_index"