Knowing is half the battle

So I am working on the next code release for Autoweb and it was time to push it out some schema changes to our testing Slony setup. Last time I tried this I ran into a few problems. Mainly there was an error about a trigger the slave could not find and the slon processes on the slaves panicked. This time was again the same story :-( I decided to dig into the SQL file the developers had put together when I saw the problem. We where doing many inserts and updates in the sql file on tables with triggers.

In slony all the triggers are disabled on the slave so you really can not do anything on the slave where you need a trigger or it will fail. When you push a SQL file out with Slony it would be just like you ran it on the lsave it self. So I leaned something I really should have know ages ago. If you do a schema change and push it out with Slony do not do any updates, inserts, or deletes. Just make the schema changes first, then on the master with your new scema in place do your updates, inserts, or deletes.

I am kicking my self hard for not figuring this stuff out sooner! Now I know and hopefully the next schema change will not be such a battle to contend with.

Leave a Reply