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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Enrico Thierbach <eno(at)open-lab(dot)org>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: SELECT .. FOR UPDATE: find out who locked a row
Date: 2018-03-15 20:38:03
Message-ID: CAKFQuwY3mECA+qiJcOSATxvvrXeEV0OXTk38h7-XNs=5UuvvQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 15, 2018 at 1:30 PM, Enrico Thierbach <eno(at)open-lab(dot)org> wrote:

> 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
>
​I'd start here:​

https://www.postgresql.org/docs/10/static/view-pg-locks.html
​​

and the pg_stat_activity view:

https://www.postgresql.org/docs/10/static/monitoring-stats.html#MONITORING-STATS-VIEWS-TABLE

The system doesn't really understand your model ID/PK field - the system
views and catalogs using system identifiers.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tiffany Thang 2018-03-15 20:40:31 Re: psql output result
Previous Message pinker 2018-03-15 20:36:14 Re: SELECT .. FOR UPDATE: find out who locked a row