Bug 254

Summary: Can't upgrade or remove an older version with a try block
Product: Slony-I Reporter: Steve Singer <ssinger>
Component: slonikAssignee: Slony Bugs List <slony1-bugs>
Status: ASSIGNED ---    
Severity: enhancement CC: slony1-bugs
Priority: low    
Version: devel   
Hardware: PC   
OS: Linux   

Description Steve Singer 2011-12-06 07:34:41 UTC
A slonik script like

try {
uninstall node(id=1);
}

or 
try {
update  functions(id=1);
}

won't work if you are upgrading from a version of slony earlier than 2.1 because the sl_event_lock table does not exist.  The try block will try to obtain an event lock but the table won't exist until after the update functions runs.
Comment 1 Christopher Browne 2011-12-12 06:23:05 UTC
I wonder if perhaps we ought to disallow putting these commands within a TRY block.

Or perhaps better, disallow combining these commands with anything else.  You can't expect

try {
    uninstall node (id=1);
    uninstall node (id=2);
}

to behave in a rollable-back-fashion...
Comment 2 Steve Singer 2011-12-12 10:36:54 UTC
I find the ability to do
try {
uninstall node(id=1);
}

very useful.  It isn't about rolling back it is about being able to catch and recover from the error if slony isn't installed.