Re: lock weirdness - Mailing list pgsql-novice

From Tom Lane
Subject Re: lock weirdness
Date
Msg-id 15842.1080488671@sss.pgh.pa.us
Whole thread Raw
In response to lock weirdness  ("Marcus Andree S. Magalhaes" <marcus.magalhaes@vlinfo.com.br>)
List pgsql-novice
"Marcus Andree S. Magalhaes" <marcus.magalhaes@vlinfo.com.br> writes:
> Got several locks of a kind that, as seen in postgres docs, "is not
> automatically acquired by any PostgreSQL command"

That part of the docs is speaking of locks on tables.  The locks that
are confusing you are not table locks, they are transaction-number
locks.  The guys who are blocked waiting for ShareLock on someone else's
transaction number are waiting for that transaction to complete,
evidently because they want to update some row it already updated.

In short, your real problem is that transaction 224384857 is being held
open instead of completing.

I'm not sure why the transaction holding that lock isn't showing up in
your output.  Possibly the join against pg_stat_activity is failing ---
there are a couple of possible reasons why pg_stat_activity might not
have a row for a backend.  Try looking at just pg_locks without the
join.

            regards, tom lane

pgsql-novice by date:

Previous
From: "Marcus Andree S. Magalhaes"
Date:
Subject: lock weirdness
Next
From: Reshat Sabiq
Date:
Subject: Re: Images in Database