Mon Jul 7 05:31:38 PDT 2008
- Previous message: [Slony1-general] how to prevent EXECUTE SCRIPT from locking alltables
- Next message: [Slony1-general] how to prevent EXECUTE SCRIPT from locking alltables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Jacques Caron wrote: > 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. What the difference between adding and removing a column ? (in the case, there's no constraint) > > 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 > > _______________________________________________ > Slony1-general mailing list > Slony1-general at lists.slony.info > http://lists.slony.info/mailman/listinfo/slony1-general -- Cyril SCETBON - Ingénieur bases de données AUSY pour France Télécom - OPF/PORTAILS/DOP/HEBEX Tél : +33 (0)4 97 12 87 60 Jabber : cscetbon at jabber.org France Telecom - Orange 790 Avenue du Docteur Maurice Donat Bâtiment Marco Polo C2 - Bureau 202 06250 Mougins France *********************************** Ce message et toutes les pieces jointes (ci-apres le 'message') sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration. Le Groupe France Telecom decline toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. Si vous n'etes pas destinataire de ce message, merci de le detruire immediatement et d'avertir l'expediteur. *********************************** This message and any attachments (the 'message') are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. Messages are susceptible to alteration. France Telecom Group shall not be liable for the message if altered, changed or falsified. If you are not recipient of this message, please cancel it immediately and inform the sender. ************************************
- Previous message: [Slony1-general] how to prevent EXECUTE SCRIPT from locking alltables
- Next message: [Slony1-general] how to prevent EXECUTE SCRIPT from locking alltables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list