Re: Clustering with minimal locking - Mailing list pgsql-general

From Decibel!
Subject Re: Clustering with minimal locking
Date
Msg-id 2272DCA5-9AFD-4B51-BBA0-9925E6B7F440@decibel.org
Whole thread Raw
In response to Re: Clustering with minimal locking  (Scott Ribe <scott_ribe@killerbytes.com>)
Responses Re: Clustering with minimal locking  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
List pgsql-general
On Jun 17, 2008, at 11:37 AM, Scott Ribe wrote:
>> BOOM! Deadlock.
>
> No more likely than with the current cluster command. Acquiring the
> lock is
> the same risk; but it is held for much less time.


Actually, no (at least in 8.2). CLUSTER grabs an exclusive lock
before it does any work meaning that it can't deadlock by itself. Of
course you could always do something like

BEGIN;
SELECT * FROM a;
CLUSTER .. ON a;
COMMIT;

Which does introduce the risk of a deadlock, but that's your fault,
not Postgres.
--
Decibel!, aka Jim C. Nasby, Database Architect  decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828



Attachment

pgsql-general by date:

Previous
From: Giorgio Valoti
Date:
Subject: Re: UTF8 encoding problem
Next
From: "Albe Laurenz"
Date:
Subject: Re: Error when trying to drop a tablespace