Re: Errors when update a view with conditional-INSTEAD rules - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Errors when update a view with conditional-INSTEAD rules
Date
Msg-id 6916.1578158024@sss.pgh.pa.us
Whole thread Raw
In response to Re: Errors when update a view with conditional-INSTEAD rules  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: Errors when update a view with conditional-INSTEAD rules  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> That included a change to rewriteTargetListIU() to prevent it from
> adding dummy targetlist entries for unassigned-to attributes for
> auto-updatable views, in case they are no longer simple references to
> the underlying relation. Instead, that is left to expand_targetlist(),
> as for a normal table. However, in this case (an UPDATE on a view with
> a conditional rule), the target relation of the original query isn't
> rewritten (we leave it to the executor to report the error), and so
> expand_targetlist() ends up adding a new targetlist entry that
> references the target relation, which is still the original view.

So why did we leave it to the executor to throw an error?  I have
a feeling it was either because the rewriter didn't have (easy?)
access to the info, or it seemed like it'd be duplicating code.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Greatest Common Divisor
Next
From: Vik Fearing
Date:
Subject: Re: Greatest Common Divisor