Re: ExclusiveLock and Python - Mailing list pgsql-admin

From Tom Lane
Subject Re: ExclusiveLock and Python
Date
Msg-id 29830.1046274625@sss.pgh.pa.us
Whole thread Raw
In response to ExclusiveLock and Python  ("Gaetano Mendola" <mendola@bigfoot.com>)
List pgsql-admin
"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

pgsql-admin by date:

Previous
From: Rajesh Kumar Mallah
Date:
Subject: CREATE OR REPLACE TABLE ...
Next
From: Robert Treat
Date:
Subject: Re: PLSQL