Waldo Nell pwnell at telkomsa.net
Mon Jul 12 08:56:45 PDT 2010
On 2010-07-12, at 06:43 , Brad Nicholson wrote:

> (assuming Y and Z are the only columns, if there are others, include
> them accordingly)
> 
> CREATE TABLE XXX_new LIKE XXX (exclude the indexes)
> INSERT INTO XXX_new (Y,Z) SELECT Y,Z where  Z <> 1;
> INSERT INTO XXX_new (Y,Z) SELECT 'Y',Z where  Z = 1;
> 
> ALTER TABLE XXX RENAME XXX_old;
> ALTER TABLE XXX_new RENAME XXX;
> 
> Then add the indexes back on (rename the indexes on XXX_old first if you
> want to maintain the index names).
> 

Do I need to run this in an EXECUTE SCRIPT? Or directly on the DB?  While Slony is running?



More information about the Slony1-general mailing list