X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A8AF14758FE for ; Wed, 26 Feb 2003 10:53:07 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 78892-08 for ; Wed, 26 Feb 2003 10:52:54 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 2EB02475ADE for ; Wed, 26 Feb 2003 10:50:22 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1QFoP5u029831; Wed, 26 Feb 2003 10:50:25 -0500 (EST) To: "Gaetano Mendola" Cc: pgsql-admin@postgresql.org Subject: Re: ExclusiveLock and Python In-reply-to: References: Comments: In-reply-to "Gaetano Mendola" message dated "Wed, 26 Feb 2003 12:30:38 +0100" Date: Wed, 26 Feb 2003 10:50:25 -0500 Message-ID: <29830.1046274625@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/403 X-Sequence-Number: 7601 "Gaetano Mendola" 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