pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gaetano Mendola <mendola@bigfoot.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: ExclusiveLock and Python
Date: Wed, 26 Feb 2003 10:50:25 -0500
Message-ID: <29830.1046274625@sss.pgh.pa.us> (raw)
In-Reply-To: <b3i8gp$1gqp$1@news.hub.org>
References: <b3i8gp$1gqp$1@news.hub.org>

"Gaetano Mendola" <mendola@bigfoot.com> writes:
> select * from pg_locks where  mode = 'ExclusiveLock';
>  relation | database | transaction |  pid  |     mode      | granted
> ----------+----------+-------------+-------+---------------+---------
>           |          |     2560899 | 20404 | ExclusiveLock | t

> ExclusiveLock on what ?

Your own transaction, that's what.

If one transaction needs to wait for a specific other transaction, it
does so by attempting to grab ShareLock on the transaction ID.  When
the other transaction completes (and releases its ExclusiveLock on its
ID), the waiter is released.

Offhand I think this is only used to implement waits associated with
SELECT FOR UPDATE row locking --- all other locks are on tables or
table-like objects.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <29830.1046274625@sss.pgh.pa.us>
Permalink:  ../29830.1046274625@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29830.1046274625@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mendola@bigfoot.com
  Subject: Re: ExclusiveLock and Python
  In-Reply-To: <29830.1046274625@sss.pgh.pa.us>
  References: <b3i8gp$1gqp$1@news.hub.org> <29830.1046274625@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox