Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group