Jacques Caron jc at oxado.com
Mon Jul 7 03:15:52 PDT 2008
Hi,

One VERY IMPORTANT point that got lost somewhere since my original 
post on the topic: the columns added MUST NOT have ANY constraints or 
defaults. Otherwise there are good chances it WILL break your 
replication, especially if there are updates/inserts into the table 
at the same time. Really think twice (or probably more times) about 
using that method with any constraint or default, and don't do it 
unless you understand how Slony works internally.

Also it only works for adding a column. Don't try to do the same for 
deleting a column. And changing a column's type, constraints, etc. is 
in most cases not possible with this method either.

In short, unless you are ADDING one column WITHOUT any constraints or 
defaults, use EXECUTE SCRIPT.

Jacques.

At 10:31 02/07/2008, hubert depesz lubaczewski wrote:

>On Tue, Jul 01, 2008 at 08:27:32AM -0700, Shahaf Abileah wrote:
> > Also, in certain situations you might be able to run the alter command
> > on each of the slaves and then on the master.  E.g. if you're adding a
> > new column that allows null values, then it might be possible to alter
> > the slaves even while rows are being inserted into the master.  You will
> > still be taking a lock on the table while altering it, but at least
> > you're not locking multiple tables at a time across multiple machines.
> > Not sure if this is recommended practice.
>
>it's not recommended, but it works.
>you add column on slave, then run this on master:
>UPDATE pg_trigger SET tgargs=substring(tgargs for 
>octet_length(tgargs)-1)||E'v\\000' where tgname = 'TRIGGER_NAME';
>and then add the column on master.
>
>best regards,
>
>depesz
>
>_______________________________________________
>Slony1-general mailing list
>Slony1-general at lists.slony.info
>http://lists.slony.info/mailman/listinfo/slony1-general



More information about the Slony1-general mailing list