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

From Simon Riggs
Subject Re: ALTER TABLE ... REPLACE WITH
Date
Msg-id 1292373214.2737.5178.camel@ebony
Whole thread Raw
In response to ALTER TABLE ... REPLACE WITH  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: ALTER TABLE ... REPLACE WITH
List pgsql-hackers
On Tue, 2010-12-14 at 16:19 -0800, Josh Berkus wrote:

> Without some means of doing a clone of the table in a single command,
> you've eliminated half the scripting work, but not helped at all with
> the other half.

I'm not trying to eliminate scripting work, I'm trying to minimise the
lock window with a reliable and smooth atomic switcheroo.

> Actually, you know what would be ideal?
> 
> REPLACE TABLE old_table WITH SELECT ...
> 
> Give it some thought ...

I have; the above would hold the lock window open while the SELECT runs
and that is explicitly something we are trying to avoid.

Good creative input though, thank you.

-- Simon Riggs           http://www.2ndQuadrant.com/books/PostgreSQL Development, 24x7 Support, Training and Services



pgsql-hackers by date:

Previous
From: Koichi Suzuki
Date:
Subject: Re: WIP patch for parallel pg_dump
Next
From: Florian Pflug
Date:
Subject: Getting "ERROR: no unpinned buffers available" on HEAD, should I investigate?