Christopher Browne cbbrowne at ca.afilias.info
Fri Feb 26 14:12:13 PST 2010
Vick Khera <vivek at khera.org> writes:
> On Wed, Feb 24, 2010 at 2:00 PM, Joseph S <jks at selectacast.net> wrote:
>> If a trigger exists on a table, when slony is installed on a slave it
>> removes the original triggers.  However if I want to add a trigger to
>> the table (to make sure my master & slave always have the same schema)
>> how do I get slony to move it to where it hid the original triggers?
>> This trigger firing on INSERT on the slave can actually cause data
>> corruption.
>
> ALL change to the db schema are to be run thru slony's EXECUTE SCRIPT
> function, which will take care of ensuring that the schema change is
> applied properly to all copies, and that slony knows about those
> changes so it can properly replicate your data (especially important
> when adding/removing columns, adding/removing foreign keys, etc.)

Yup, what you said :-).

Note that if you install a trigger via EXECUTE SCRIPT, it will...

 - Get installed on *all* nodes
 - Get hidden on all nodes other than the origin

[I'm assuming we're talking about 1.2; on 2.0, the trigger will be
visible everywhere, but just not run everywhere.]

It's worth reading the following which gives more details about the
differences between 1.2 and 2.0:
  <http://www.slony.info/documentation/triggers.html>
-- 
(format nil "~S@~S" "cbbrowne" "ca.afilias.info")
Christopher Browne
"Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"


More information about the Slony1-general mailing list