From: | "Carlos Oliva" <carlos(at)pbsinet(dot)com> |
---|---|
To: | "'Michael Fuhr'" <mike(at)fuhr(dot)org> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: ExclusiveLock without a relation in pg_locks |
Date: | 2006-02-23 16:08:07 |
Message-ID: | 200602231608.LAA18948@pbsi.pbsinet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thank you very much for your answer. I think that I am seeing those self
transaction id locks as "ExclusiveLocks"
Would you expect to see an "ExclusiveLock" with a query of type Select (not
Select Update or Update or Insert)?
-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Michael Fuhr
Sent: Thursday, February 23, 2006 10:05 AM
To: Carlos Oliva
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] ExclusiveLock without a relation in pg_locks
On Thu, Feb 23, 2006 at 08:54:36AM -0500, Carlos Oliva wrote:
> Would connections to a database require crating an extra ExclusiveLock? We
> have some connections to the database that happen to be "idle in
> transaction" and their pids have a granted "Exclusive Lock" in pg_locks.
I
> cannot discern the tables where the ExclusiveLock is being held because
the
> relation field is blank.
http://www.postgresql.org/docs/8.1/interactive/view-pg-locks.html
"Every transaction holds an exclusive lock on its transaction ID
for its entire duration. If one transaction finds it necessary to
wait specifically for another transaction, it does so by attempting
to acquire share lock on the other transaction ID. That will succeed
only when the other transaction terminates and releases its locks."
If the relation column is null then you're probably seeing these
transaction ID locks.
> How could I find out the tables that are being locked when I see an
> "ExclusiveLock" in pg_locks.
An easy way to convert a relation's oid to its name is to cast it
to regclass:
SELECT relation::regclass AS relname, * FROM pg_locks;
--
Michael Fuhr
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly
From | Date | Subject | |
---|---|---|---|
Next Message | Carlos Oliva | 2006-02-23 16:08:19 | Re: ExclusiveLock without a relation in pg_locks |
Previous Message | Vivek Khera | 2006-02-23 15:46:54 | Re: upgrade PostgreSQL 8.x on production FreeBSD |