Re: Errors when update a view with conditional-INSTEAD rules

2020-01-21 Thread Pengzhou Tang
> I am wondering whether a simple auto-updatable view can have a > conditional update instead rule. > > Well, the decision reached in [1] was that we wouldn't allow that. We > could decide to allow it now as a new feature enhancement, but it > wouldn't be a back-patchable bug-fix, and to be honest

Re: Errors when update a view with conditional-INSTEAD rules

2020-01-17 Thread Dean Rasheed
On Fri, 17 Jan 2020 at 06:14, Pengzhou Tang wrote: > > I am wondering whether a simple auto-updatable view can have a conditional > update instead rule. Well, the decision reached in [1] was that we wouldn't allow that. We could decide to allow it now as a new feature enhancement, but it wouldn'

Re: Errors when update a view with conditional-INSTEAD rules

2020-01-16 Thread Pengzhou Tang
Thanks a lot, Dean, to look into this and also sorry for the late reply. On Sun, Jan 5, 2020 at 12:08 AM Dean Rasheed wrote: > Tracing it through, this seems to be a result of > cab5dc5daf2f6f5da0ce79deb399633b4bb443b5 which added support for > updatable views with a mix of updatable and non-upd

Re: Errors when update a view with conditional-INSTEAD rules

2020-01-14 Thread Dean Rasheed
On Tue, 7 Jan 2020 at 11:00, Dean Rasheed wrote: > > Here's a patch along those lines. Yes, it's a little more code > duplication, but I think it's worth it for the more detailed error. > There was no previous regression test coverage of this case so I added > some (all other test output is unalte

Re: Errors when update a view with conditional-INSTEAD rules

2020-01-07 Thread Dean Rasheed
On Sat, 4 Jan 2020 at 18:12, Dean Rasheed wrote: > > On Sat, 4 Jan 2020 at 17:13, Tom Lane wrote: > > > > Dean Rasheed writes: > > > That included a change to rewriteTargetListIU() to prevent it from > > > adding dummy targetlist entries for unassigned-to attributes for > > > auto-updatable view

Re: Errors when update a view with conditional-INSTEAD rules

2020-01-04 Thread Dean Rasheed
On Sat, 4 Jan 2020 at 17:13, Tom Lane wrote: > > Dean Rasheed 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 under

Re: Errors when update a view with conditional-INSTEAD rules

2020-01-04 Thread Tom Lane
Dean Rasheed 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

Re: Errors when update a view with conditional-INSTEAD rules

2020-01-04 Thread Dean Rasheed
On Tue, 3 Dec 2019 at 11:06, Pengzhou Tang wrote: > > Hi Hackers, > > I hit an error when updating a view with conditional INSTEAD OF rules, the > reproduce steps are list below: > > CREATE TABLE t1(a int, b int); > CREATE TABLE t2(a int, b int); > CREATE VIEW v1 AS SELECT * FROM t1 where b > 100