From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Vik Fearing <vik@postgresfriends.org>
Cc: pavel.boev@invitae.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16913: GENERATED AS IDENTITY column nullability is affected by order of column properties
Date: Fri, 12 Mar 2021 10:30:48 -0500
Message-ID: <2441173.1615563048@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+HiwqG6V8=emTcBkZhAOU7bci_QSeSy5wVazEtitGtkEBKVgg@mail.gmail.com>
References: <16913-3b5198410f67d8c6@postgresql.org>
<7c02b352-a2e4-e71a-ae69-7e410daf5774@postgresfriends.org>
<ce93e6a9-1a36-795b-cc1f-819107e82005@postgresfriends.org>
<CA+HiwqG6V8=emTcBkZhAOU7bci_QSeSy5wVazEtitGtkEBKVgg@mail.gmail.com>
Amit Langote <amitlangote09@gmail.com> writes:
> On Thu, Mar 11, 2021 at 11:37 PM Vik Fearing <vik@postgresfriends.org> wrote:
>> On 3/4/21 3:22 PM, Vik Fearing wrote:
>>> I can confirm this bug. Attached is a patch to prevent it.
>> Would anybody like to take a look at this?
> Patch looks reasonable to me.
I think it's not really necessary to have two different tests; we can
just make the code for IDENTITY include exactly what the code for
CONSTR_NOTNULL does, ie it can set saw_not_null too. The point here
is that IDENTITY can be read as implicitly including NOT NULL, so we
can just act as though that was explicit.
An alternative fix approach is to add to the list of conflict checks
that are made after the loop, but I'm not sure that's any better.
Will push it in a bit.
regards, tom lane
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: tgl@sss.pgh.pa.us, amitlangote09@gmail.com, vik@postgresfriends.org, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16913: GENERATED AS IDENTITY column nullability is affected by order of column properties
In-Reply-To: <2441173.1615563048@sss.pgh.pa.us>
* 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