From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Peter Geoghegan <pg@bowt.ie>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Mario De Frutos Dieguez <mariodefrutos@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: Fwd: Problem with a "complex" upsert
Date: Tue, 31 Jul 2018 10:11:51 +0900
Message-ID: <2d65f4a8-9a15-7ab6-cb39-d7347deaacd5@lab.ntt.co.jp> (raw)
In-Reply-To: <CAH2-WzkW7pYx5M=NDGcnmPRMmum_jJPSdCVi1w6d=dmcvez-2A@mail.gmail.com>
References: <CAFYwGJ0xfzy8jaK80hVN2eUWr6huce0RU8AgU04MGD00igqkTg@mail.gmail.com>
<CAFYwGJ3Cpb2T+177rEopU7_aQE3W03UoqNZXdP5erCtSRgDGVA@mail.gmail.com>
<18795.1529600753@sss.pgh.pa.us>
<8da3739d-da24-1125-cab6-b68d6ec1bc6a@lab.ntt.co.jp>
<30415.1531256373@sss.pgh.pa.us>
<CAH2-WzkW7pYx5M=NDGcnmPRMmum_jJPSdCVi1w6d=dmcvez-2A@mail.gmail.com>
On 2018/07/31 7:53, Peter Geoghegan wrote:
> On Tue, Jul 10, 2018 at 1:59 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> I tried debugging why that happens and concluded that rewriteTargetView
>>> fails to *completely* account for the fact that the view's column's may
>>> have different attribute numbers than the underlying table that the DO
>>> UPDATE action will be applied to. Especially, even if the view's Vars are
>>> replaced with those corresponding underlying base table's columns, the
>>> TargetEntry's into which those Vars are contained are not refreshed, that
>>> is, their resnos don't match varattnos.
>>
>>> I created a patch that seems to fix the issue, which also adds a
>>> representative test in updatable_view.sql.
>>
>> Hm. I looked at this patch a bit. While the onConflictSet change looks
>> reasonable, I find the exclRelTlist change fishy. Shouldn't those resnos
>> correspond to the exclRelTlist's *own* vars, independently of what is or
>> isn't in the view_targetlist? And why is it OK to ignore failure to find
>> a match?
>
> Any update on this, Amit? I would like to get this one out of the way soon.
This has slipped my mind. I will look into updating the patch today.
Thanks,
Amit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: Langote_Amit_f8@lab.ntt.co.jp, pg@bowt.ie, tgl@sss.pgh.pa.us, mariodefrutos@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: Fwd: Problem with a "complex" upsert
In-Reply-To: <2d65f4a8-9a15-7ab6-cb39-d7347deaacd5@lab.ntt.co.jp>
References: <CAFYwGJ0xfzy8jaK80hVN2eUWr6huce0RU8AgU04MGD00igqkTg@mail.gmail.com> <CAFYwGJ3Cpb2T+177rEopU7_aQE3W03UoqNZXdP5erCtSRgDGVA@mail.gmail.com> <18795.1529600753@sss.pgh.pa.us> <8da3739d-da24-1125-cab6-b68d6ec1bc6a@lab.ntt.co.jp> <30415.1531256373@sss.pgh.pa.us> <CAH2-WzkW7pYx5M=NDGcnmPRMmum_jJPSdCVi1w6d=dmcvez-2A@mail.gmail.com> <2d65f4a8-9a15-7ab6-cb39-d7347deaacd5@lab.ntt.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox