From: Michael A. Schulte <michael.schulte@sun.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Gaetano Mendola <mendola@bigfoot.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: ExclusiveLock and Python
Date: Fri, 28 Feb 2003 09:57:51 +0100
Message-ID: <3E5F248F.8020606@sun.com> (raw)
References: <b3i8gp$1gqp$1@news.hub.org>
<29830.1046274625@sss.pgh.pa.us>
Tom Lane wrote:
> "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.
What about two processes updating the same row? I thougth
PostGres locks the row in this case and this would also
be reflected as an entry in pg_locks with mode
ExclusiveLock.
michael
--
Michael Schulte, Solaris Kernel Development, Sun Microsystems
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: michael.schulte@sun.com, tgl@sss.pgh.pa.us, mendola@bigfoot.com
Subject: Re: ExclusiveLock and Python
In-Reply-To: <3E5F248F.8020606@sun.com>
References: <b3i8gp$1gqp$1@news.hub.org> <29830.1046274625@sss.pgh.pa.us> <3E5F248F.8020606@sun.com>
* 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