Re: Views + Rules + Triggers + 7.3.2 = Upgrade Problems (was: Re: REWRITE_INVOKE_MAX and "query may contain cycles" ) - Mailing list pgsql-general

From Eric B.Ridge
Subject Re: Views + Rules + Triggers + 7.3.2 = Upgrade Problems (was: Re: REWRITE_INVOKE_MAX and "query may contain cycles" )
Date
Msg-id E5AFAD0B-5580-11D7-9E6C-0003937E3354@tcdi.com
Whole thread Raw
In response to Re: Views + Rules + Triggers + 7.3.2 = Upgrade Problems (was: Re: REWRITE_INVOKE_MAX and "query may contain cycles" )  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Thursday, March 13, 2003, at 12:51  PM, Tom Lane wrote:
> "Eric B. Ridge" <ebr@tcdi.com> writes:
>> I would have expected "id" to be '1' in both rows.  In fact, for what
>> I'm trying to do, it's a requirement.
>
> Then use a trigger to capture the inserted row...

I was afraid you'd say that.

>> Can anyone explain why NEW.id is being re-evaluated for each statement
>> in the rule?  Is this by design?
>
> Because the rule is a macro.  Yes, it's by design.

Makes sense,  but it's counter-intuitive.  Only 1 INSERT is being
issued against the view.

eric


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Views + Rules + Triggers + 7.3.2 = Upgrade Problems (was: Re: REWRITE_INVOKE_MAX and "query may contain cycles" )
Next
From: "Roman Fail"
Date:
Subject: PL/Java (was: stored procedures)