Jan Wieck JanWieck at Yahoo.com
Mon Jun 4 19:29:46 PDT 2007
On 6/4/2007 10:44 AM, Andrew Sullivan wrote:
> On Mon, Jun 04, 2007 at 04:06:47PM +0200, Michal Taborsky - Internet Mall wrote:
>> 
>> Wouldn't it be possible to check the script for these commands 
>> beforehand, then? I mean, it would be real nice, if slonik produced an 
>> error message, instead of breaking things.
> 
> Which version of Postgres are you on?  It may not actually break
> things under post 8.x, because there's subtransaction support in
> there.  

No, the subtransactions use different syntax. However, at some point (I 
don't recall when) Postgres changed from an ERROR to a WARNING in the 
case of BEGIN inside of a transaction and COMMIT outside of one. What 
therefore has happened is that the code for EXECUTE restored the 
original table state without slony triggers but with all user triggers 
in place and ran the script. Somewhere in the script it hit the BEGIN, 
issuing a WARNING, continued until COMMIT and of course, did that. From 
then on every single statement following (in the script or by slony) was 
outside a transaction block and the first one to fail would probably 
cause slonik to terminate whatever it was doing before putting the 
tables back into replicated state.

> 
> It would indeed be nice to have a slonik script validator in place to
> run through before doing things; so far, nobody has been inspired to
> write one, possibly because there's a great whack of things that it
> probably wouldn't be able to test without completely reproducing
> your setup.  I can say that we _never_ run a DDL without first trying
> out the script in a test environment, for exactly this reason.

Agreed.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck at Yahoo.com #


More information about the Slony1-general mailing list