Re: ExclusiveLock and Python

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: ExclusiveLock and Python
Date: 2003-02-26 15:50:25
Message-ID: 29830.1046274625@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Gaetano Mendola" <mendola(at)bigfoot(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Robert Treat 2003-02-26 17:04:11 Re: PLSQL
Previous Message Rajesh Kumar Mallah 2003-02-26 12:37:37 CREATE OR REPLACE TABLE ...