Re: lock weirdness

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marcus Andree S(dot) Magalhaes" <marcus(dot)magalhaes(at)vlinfo(dot)com(dot)br>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: lock weirdness
Date: 2004-03-28 15:44:31
Message-ID: 15842.1080488671@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Marcus Andree S. Magalhaes" <marcus(dot)magalhaes(at)vlinfo(dot)com(dot)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

In response to

  • lock weirdness at 2004-03-28 12:24:43 from Marcus Andree S. Magalhaes

Browse pgsql-novice by date

  From Date Subject
Next Message Reshat Sabiq 2004-03-28 17:46:40 Re: Images in Database
Previous Message Marcus Andree S. Magalhaes 2004-03-28 12:24:43 lock weirdness