X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 707EBD1DCFA for ; Wed, 21 Apr 2004 11:58:59 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 91096-10 for ; Wed, 21 Apr 2004 11:58:56 -0300 (ADT) Received: from mail.bluecatnetworks.com (mail.bluecatnetworks.com [209.167.177.42]) by svr1.postgresql.org (Postfix) with ESMTP id 2529AD1DC2B for ; Wed, 21 Apr 2004 11:58:51 -0300 (ADT) Received: from [172.18.0.2] ([172.18.0.2]:21301 "EHLO COLOSSUS.dyadem.corp" ident: "NO-IDENT-SERVICE[2]") by mail.bluecatnetworks.com with ESMTP id ; Wed, 21 Apr 2004 10:54:01 -0400 Received: from COLOSSUS.dyadem.corp ([172.17.0.22]) by COLOSSUS.dyadem.corp with Microsoft SMTPSVC(5.0.2195.6713); Wed, 21 Apr 2004 10:58:29 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C427B1.1B0BA282" Subject: Which SQL command creates ExclusiveLock? Date: Wed, 21 Apr 2004 10:58:28 -0400 Message-ID: <5DEC3FFCDE2F7C4DA45433EE09A4F22C013457FF@colossus.dyadem.corp> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Which SQL command creates ExclusiveLock? Thread-Index: AcQnsD+/TdZzd9eZT3yZroU9cF9Cdw== From: "Denis Khabas" To: X-OriginalArrivalTime: 21 Apr 2004 14:58:29.0090 (UTC) FILETIME=[1B1E9420:01C427B1] X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=HTML_50_60, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200404/288 X-Sequence-Number: 17663 This is a multi-part message in MIME format. ------_=_NextPart_001_01C427B1.1B0BA282 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi everyone! =20 I have a web application that uses Postgresql on backend. The application p= erforms selects, updates, inserts, and deletes by using Hibernate. Tables contain indexed fields. When I run the following query, SELECT * FROM pg_lo= cks, it shows that some transactions place ExclusiveLock: =20 relation | database | transaction | pid | mode | granted ----------+----------+-------------+-------+-----------------+--------- 16757 | 16976 | | 22770 | AccessShareLock | t | | 17965163 | 22770 | ExclusiveLock | t =20 According to postgres documentation, all update operations place ROW EXCLUS= IVE MODE locks, and=20 EXCLUSIVE MODE is not automatically acquired by any postgres SQL command. S= o, which command places ExclusiveLock??? I suspect that indexes can account for this behaviour, but= couldn't find anything in the docs. I am also wondering why there is nothing shown in "relation" column. I thin= k it is supposed to display a table or index id or any other object that is being locked. =20 Thanks for help! =20 Dennis =20 ------_=_NextPart_001_01C427B1.1B0BA282 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi=20 everyone!
 
I have a = web=20 application that uses Postgresql on backend. The application performs selec= ts,=20 updates, inserts, and deletes by using Hibernate. Tables
contain i= ndexed=20 fields. When I run the following query, SELECT * FROM pg_locks, it shows th= at=20 some transactions place
ExclusiveLock:
 
 relation | database | transaction |&= nbsp;=20 pid     =20 |      mode     &n= bsp;=20 |=20 granted
----------+----------+-------------+-------+-----------------+--= -------
   =20 16757 |    16976=20 |            &n= bsp;     | 22770  | AccessShareLock |=20 t
            =20  |          <= SPAN=20 class=3D440423014-21042004>   |    17965163= |=20 22770  | ExclusiveLock &n= bsp; |=20 t
 
Acc= ording to=20 postgres documentation, all update operations place ROW EXCLUSIVE MODE locks, and
EXCLUSIVE MODE is not automatic= ally=20 acquired by any postgres SQL command. So, which command=20 places
ExclusiveLock??? I suspect that= =20 indexes can account for this behaviour, but couldn't find anything in the= =20 docs.
I am also wondering why there is nothing shown i= n=20 "relation" column. I think it is supposed to display a table or index id or= any=20 other
object that is being=20 locked.
 
Tha= nks for=20 help!
 
Dennis

 
------_=_NextPart_001_01C427B1.1B0BA282--