Skip site navigation (1) Skip section navigation (2)

Re: CLUSTER, using SHARE UPDATE EXCLUSIVE lock?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Jonathan Scher <js(at)oxado(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: CLUSTER, using SHARE UPDATE EXCLUSIVE lock?
Date: 2007-03-01 18:47:56
Message-ID: 20070301184756.GE1705@svana.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Mar 01, 2007 at 06:23:37PM +0100, Jonathan Scher wrote:
> >Because when it drops the old copy of the table there had better not be
> >any concurrent readers.

> Then, is it possible to take a share update exclusive lock until the new 
> table is ready, then an access exclusive one only in order to switch 
> tables? I don't think it's already coded like that...

That's lock upgrading, which opens you up to deadlocks. If another
process grabs a lock after your update exclusive, you're not going to
be able to upgrade it.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog(at)svana(dot)org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-03-01 19:17:20
Subject: Re: [HACKERS] Deadlock with pg_dump?
Previous:From: Darcy BuskermolenDate: 2007-03-01 18:07:27
Subject: Re: Possible Bug: high CPU usage for stats collector in 8.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group