From: Denis Khabas <dkhabas@bluecatnetworks.com>
To: pgsql-sql@postgresql.org
Subject: Which SQL command creates ExclusiveLock?
Date: Wed, 21 Apr 2004 10:58:28 -0400
Message-ID: <5DEC3FFCDE2F7C4DA45433EE09A4F22C013457FF@colossus.dyadem.corp> (raw)
Hi everyone!
I have a web application that uses Postgresql on backend. The application performs selects, updates, inserts, and deletes by using Hibernate. Tables
contain indexed fields. When I run the following query, SELECT * FROM pg_locks, it shows that some transactions place
ExclusiveLock:
relation | database | transaction | pid | mode | granted
----------+----------+-------------+-------+-----------------+---------
16757 | 16976 | | 22770 | AccessShareLock | t
| | 17965163 | 22770 | ExclusiveLock | t
According to postgres documentation, all update operations place ROW EXCLUSIVE MODE locks, and
EXCLUSIVE MODE is not automatically acquired by any postgres SQL command. So, 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 think it is supposed to display a table or index id or any other
object that is being locked.
Thanks for help!
Dennis
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dkhabas@bluecatnetworks.com
Subject: Re: Which SQL command creates ExclusiveLock?
In-Reply-To: <5DEC3FFCDE2F7C4DA45433EE09A4F22C013457FF@colossus.dyadem.corp>
* 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