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
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
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
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
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
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