Re: ALTER TABLE ... REPLACE WITH

Josh Berkus <josh@agliodbs.com>

From: Josh Berkus <josh@agliodbs.com>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org
Date: 2010-12-15T01:45:18Z
Lists: pgsql-hackers
> I have; the above would hold the lock window open while the SELECT runs
> and that is explicitly something we are trying to avoid.

Not necessarily.  You could copy into a temp table first, and then swap.

-- 
                                  -- Josh Berkus
                                     PostgreSQL Experts Inc.
                                     http://www.pgexperts.com