Re: BUG #15623: Inconsistent use of default for updatable view - Mailing list pgsql-bugs

From Dean Rasheed
Subject Re: BUG #15623: Inconsistent use of default for updatable view
Date
Msg-id CAEZATCVGid6C7v6aMdA_7ZKPJPGYpwQ2bQhYrZ0=E5RDJQp7yw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #15623: Inconsistent use of default for updatable view  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: BUG #15623: Inconsistent use of default for updatable view
Re: BUG #15623: Inconsistent use of default for updatable view
Re: BUG #15623: Inconsistent use of default for updatable view
List pgsql-bugs
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.

Regards,
Dean

Attachment

pgsql-bugs by date:

Previous
From: "Saul, Jean Paolo"
Date:
Subject: Re: BUG #15609: synchronous_commit=off insert performance regressionwith secondary indexes
Next
From: Peter Eisentraut
Date:
Subject: Re: BUG #15631: Generated as identity field in a temporary table withon commit drop corrupts system catalogs