Re: [GENERAL] The rule question before, request official documentation on the problem

2007-04-11 Thread Martijn van Oosterhout
On Wed, Apr 11, 2007 at 09:21:46AM -0700, Chris Travers wrote: > DO ALSO rules involving NEW are fundamentally dangerous to the integrity > of data because NEW is not guaranteed to be internally consistent. DO > INSTEAD rules are fine (there is only one NEW), as are any DO ALSO rules > involvin

Re: [GENERAL] The rule question before, request official documentation on the problem

2007-04-11 Thread Chris Travers
Listmail wrote: Since we now have UPDATE/INSERT/DELETE RETURNING, one could imagine the rules using these to access the actual rows and not the expressions... But there is a perfectly valid argument against that : - There already is a mechanism designed specifically for this

Re: [GENERAL] The rule question before, request official documentation on the problem

2007-04-11 Thread Listmail
Rules mess with queries. For data copying/archiving kinds of tasks, triggers are a better bet, like you suggested in your original post. Let me put that a different way: rules can *only* be used where data integrity is not at stake. My own thinking is that it might be time to make an officia

Re: [GENERAL] The rule question before, request official documentation on the problem

2007-04-11 Thread Stuart Cooper
I just came up with a far more problematic case too and wonder if documentation is enough. Maybe we should warn about potential problems more loudly. Imagine the following case: insert into test_table (test) values (random()) where an insert rule propagates the changes faithfully to the next

Re: [GENERAL] The rule question before, request official documentation on the problem

2007-04-11 Thread Chris Travers
Hmm. I just came up with a far more problematic case too and wonder if documentation is enough. Maybe we should warn about potential problems more loudly. Imagine the following case: insert into test_table (test) values (random()) where an insert rule propagates the changes faithfully

Re: [GENERAL] The rule question before, request official documentation on the problem

2007-04-10 Thread Stuart Cooper
My request at this point is to officially and clearly document this as a substantial limitation of rules. It is not obvious that this is how rules are supposed to behave in this case, and even assuming that the current behavior is desired, it would be nice to let us know this :-) It's documente