Re: ALTER TABLE ... REPLACE WITH - Mailing list pgsql-hackers

From Robert Haas
Subject Re: ALTER TABLE ... REPLACE WITH
Date
Msg-id AANLkTimCozc0GQcuCS79GvPmZeTE6VQwOC3ahndz5tpe@mail.gmail.com
Whole thread Raw
In response to Re: ALTER TABLE ... REPLACE WITH  (Josh Berkus <josh@agliodbs.com>)
Responses Re: ALTER TABLE ... REPLACE WITH  (Csaba Nagy <ncslists@googlemail.com>)
List pgsql-hackers
On Tue, Dec 14, 2010 at 2:34 PM, Josh Berkus <josh@agliodbs.com> wrote:
> On 12/14/10 11:07 AM, Robert Haas wrote:
>> Because then you have to take an AccessExclusiveLock on the target
>> table, of course.
>
> Well, you have to do that for DROP TABLE as well, and I don't see any
> way around doing it for REPLACE WITH.

Sure, but in Simon's proposal you can load the data FIRST and then
take a lock just long enough to do the swap.  That's very different
from needing to hold the lock during the whole data load.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: ALTER TABLE ... REPLACE WITH
Next
From: Dimitri Fontaine
Date:
Subject: Re: pg_execute_from_file, patch v10