Bug 254 - Can't upgrade or remove an older version with a try block
Summary: Can't upgrade or remove an older version with a try block
Alias: None
Product: Slony-I
Classification: Unclassified
Component: slonik (show other bugs)
Version: devel
Hardware: PC Linux
: low enhancement
Assignee: Slony Bugs List
Depends on:
Reported: 2011-12-06 07:34 UTC by Steve Singer
Modified: 2011-12-12 10:36 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Steve Singer 2011-12-06 07:34:41 UTC
A slonik script like

try {
uninstall node(id=1);

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.