From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Roger Curley <rocurley@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>
Subject: Re: BUG #15623: Inconsistent use of default for updatable view
Date: Wed, 13 Feb 2019 12:02:25 +0900
Message-ID: <fa629211-4476-6dcd-25fe-963e7b84cf88@lab.ntt.co.jp> (raw)
In-Reply-To: <CAEZATCVGid6C7v6aMdA_7ZKPJPGYpwQ2bQhYrZ0=E5RDJQp7yw@mail.gmail.com>
References: <15623-5d67a46788ec8b7f@postgresql.org>
<952caeff-2cc7-6db9-1f2b-418442b51045@lab.ntt.co.jp>
<CAEZATCUmSp3-8nLOpgGcPkpUEXK9TJGM=iA6q4E2Sn=+bwkKNA@mail.gmail.com>
<CA+HiwqGyuNo7O-G0LUz-=1f4ZSSST4-9sLhP+Twx-PFJSPRfug@mail.gmail.com>
<CAEZATCXTg_gxzf86+eTyLzJCY3OACQ71Wo_TPaeZyNAuo7frOA@mail.gmail.com>
<CAEZATCX1cN4Lcd80ZJXHf7qVRrMReOSOUF_0Z6YFhk89NNcGbw@mail.gmail.com>
<CAEZATCVGid6C7v6aMdA_7ZKPJPGYpwQ2bQhYrZ0=E5RDJQp7yw@mail.gmail.com>
Hi Dean,
On 2019/02/12 19:33, Dean Rasheed wrote:
> On Sun, 10 Feb 2019 at 11:18, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>> On Sun, 10 Feb 2019 at 00:48, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>>> However, this is still not the end of the story, because it doesn't
>>> fix the fact that, if the view has a DO ALSO rule on it, single-row
>>> inserts behave differently from multi-row inserts. In that case, each
>>> insert becomes 2 inserts, and defaults need to be treated differently
>>> in each of the 2 queries. That's going to need a little more thought.
>>>
>>
>> Here's an updated patch to handle that case.
>>
>> In case it's not obvious, I'm not intending to try to get this into
>> next week's updates -- more time is needed to be sure of this fix.
>
> So I did some more testing of this and I'm reasonably happy that this
> now fixes the originally reported issue of inconsistent handling of
> DEFAULTS in multi-row VALUES lists vs single-row ones. I tested
> various other scenarios involving conditional/unconditional
> also/instead rules, and I didn't find any other surprises. Attached is
> an updated patch with improved comments, and a little less code
> duplication.
Thanks for updating the patch.
I can't really comment on all of the changes that that you made
considering various cases, but became curious if the single-row and
multi-row inserts cases could share the code that determines if the
DEFAULT item be replaced by the target-relation-specified default or NULL?
IOW, is there some reason why we can't avoid the special handling for the
multi-row (RTE_VALUES) case?
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: Langote_Amit_f8@lab.ntt.co.jp, dean.a.rasheed@gmail.com, amitlangote09@gmail.com, rocurley@gmail.com, noreply@postgresql.org
Subject: Re: BUG #15623: Inconsistent use of default for updatable view
In-Reply-To: <fa629211-4476-6dcd-25fe-963e7b84cf88@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