Geoffrey lists at serioustechnology.com
Wed Mar 4 04:49:46 PST 2009
Christopher Browne wrote:
> Geoffrey <lists at serioustechnology.com> writes:
>> As I've noted in the past, because of our software design, I can not
>> use the 'execute script' process for adding a field to a table.  That
>> being said, I'm looking for an alternative approach.  As it stands,
>> when we need to add a table, we plan to shut slony down, create a new
>> set for that table and restart slony.
>>
>> What would be the best way to add a field to a replicated table using
>> this scenario?  That is, shutting slony down, making the change and
>> starting slony back up.  I'm assuming that I can't simply add the
>> field to both nodes and restart slony, but if that would work, that
>> would be great.
.
.
<snip>
.
.
> The amount of "surgery" you seem to want to do concerns me somewhat...
> It sounds likely to lead to an unhappy ending, and unhappy users
> aren't what we want.

After reviewing your concerns, I've come up with a different approach to 
this problem, which really is probably a whole lot better then my 
previous idea.  That being said, I'm still going to have to set the 
slony triggers to 'fire always' but I'd like some input on my solution.

The idea is that since I'm going to likely have to lock my users out of 
the database when I add a field to a table, why not simply use the 
'execute script' solution anyway.  That is:

1. lock users out
2. execute script ....
3. set slony triggers to 'fire always'
4. let users back in

Two questions about that approach.  First, will it work?  Second, if I 
add a single field to a single table is the slony trigger on that table 
the only one that is removed and re-added?


As for adding a new table is this a reasonable solution:

1. add table to master database
2. create a new set for that table
3. start replicating that set

Or, do I need to shut slony down in order to accomplish this?

Thanks for any insights.

-- 
Until later, Geoffrey

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
  - Benjamin Franklin


More information about the Slony1-general mailing list