From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Thomas Good <tomg@nrnet.org>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] idiom to mv recs => [NEW] bleeding lock?
Date: Mon, 26 Oct 1998 16:57:39 +0200
Message-ID: <l03110704b25a3c6c5c8a@[147.233.159.109]> (raw)
In-Reply-To: <Pine.LNX.3.96.981026080614.14466A-100000@mailhost.nrnet.org>
References: <m0zXjTi-000EBPC@orion.SAPserv.Hamburg.dsh.de>
At 15:18 +0200 on 26/10/98, Thomas Good wrote:
> My point: when attempting to do a SELECT the table lock blocks even
> this activity. Is this a bleeding lock? Shouldn't a simple SELECT
> succeed? I dunno...but this is problematic as users are looking for
> info while the data entry person is doing her thing...ouch.
This lock is an exclusive lock. There is no other kind of lock in Postgres.
One may give up the LOCK at the beginning of the transaction. This would
mean that if a reader came and went before the deletion of the record, it
would succeed, because up to that point the transaction holds a shared lock
on the table. If a writer appeared, then it would fail, because it would
try to change the lock on the table from shared to exclusive, which it
can't do until all readers relinquished their locks.
This, however, creates a possibility that the deletion phase (and the
entire transaction) would fail, because the lock would fail to convert to
exclusive because other readers are still holding it.
Herouth
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: herouth@oumail.openu.ac.il, tomg@nrnet.org
Subject: Re: [SQL] idiom to mv recs => [NEW] bleeding lock?
In-Reply-To: <l03110704b25a3c6c5c8a@[147.233.159.109]>
References: <m0zXjTi-000EBPC@orion.SAPserv.Hamburg.dsh.de> <l03110704b25a3c6c5c8a@[147.233.159.109]>
* 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