Re: insert on conflict on updatable views

2018-08-01 Thread Amit Langote
On 2018/08/02 11:24, Peter Geoghegan wrote: > On Wed, Aug 1, 2018 at 7:15 PM, Amit Langote > wrote: >> create table foo (a int unique, b text); >> create view foo_view as select b, a+1 as c, a from foo; >> >> explain insert into foo_view (a, b) select 1, 2 on conflict (a) do update >> set b = excl

Re: insert on conflict on updatable views

2018-08-01 Thread Peter Geoghegan
On Wed, Aug 1, 2018 at 7:15 PM, Amit Langote wrote: > create table foo (a int unique, b text); > create view foo_view as select b, a+1 as c, a from foo; > > explain insert into foo_view (a, b) select 1, 2 on conflict (a) do update > set b = excluded.b where excluded.c > 0; > IOW, the EXCLUDED pse

insert on conflict on updatable views

2018-08-01 Thread Amit Langote
Hi. While working on updating the patch for the bug reported below: https://www.postgresql.org/message-id/flat/CAFYwGJ0xfzy8jaK80hVN2eUWr6huce0RU8AgU04MGD00igqkTg%40mail.gmail.com I noticed that the EXCLUDED pseudo-relation allows accessing columns that, ISTM, should rather be inaccessible. Exa