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

From: Eric B(dot)Ridge <ebr(at)tcdi(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Views + Rules + Triggers + 7.3.2 = Upgrade Problems (was: Re: REWRITE_INVOKE_MAX and "query may contain cycles" )
Date: 2003-03-13 18:23:32
Message-ID: E5AFAD0B-5580-11D7-9E6C-0003937E3354@tcdi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday, March 13, 2003, at 12:51 PM, Tom Lane wrote:
> "Eric B. Ridge" <ebr(at)tcdi(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Roman Fail 2003-03-13 18:26:34 PL/Java (was: stored procedures)
Previous Message Chad R. Larson 2003-03-13 17:52:43 Re: removal from list