On 4/26/2005 5:58 PM, Tom Lane wrote:
> David Wheeler <david(at)kineticode(dot)com> writes:
>> No, you can have multiple queries--you just have to understand that
>> those that come first might have an effect on those that come later.
> ... which indeed can be a feature, not a bug, depending on what you're
> doing ...
> regards, tom lane
There is no such thing as a free lunch here. If one wants a row inserted
by one action being visible by a subsequent one, then a delete done in
another action must (by default) be visible to subsequent actions as
well. I don't think that fiddling with scan-command-ID's on top of the
rule definitions will make the average user understand them easier.
The multi-action rules usually come into play when someone attempts to
make join-views updatable. Not an easy problem, granted, but most of the
time I have found a combination of rules together with ON UPDATE/DELETE
CASCADE constraints or even user defined triggers absolutely sufficient.
The INSERT and UPDATE case is handled by rules as usual. And in the
DELETE case the rule just deletes the critical rows and the ON DELETE
CASCADE constraints do the rest.
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #
In response to
pgsql-hackers by date
|Next:||From: Rod Taylor||Date: 2005-04-27 00:16:32|
|Subject: Re: [PERFORM] Bad n_distinct estimation; hacks suggested?|
|Previous:||From: John DeSoi||Date: 2005-04-27 00:02:30|
|Subject: Re: [HACKERS] Continue transactions after errors in psql |