Re: BUG #16913: GENERATED AS IDENTITY column nullability is affected by order of column properties

From: Shay Rojansky <roji(at)roji(dot)org>
To: Vik Fearing <vik(at)postgresfriends(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Langote <amitlangote09(at)gmail(dot)com>, pavel(dot)boev(at)invitae(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16913: GENERATED AS IDENTITY column nullability is affected by order of column properties
Date: 2021-05-14 20:06:05
Message-ID: CADT4RqAwD3A=RvGiQU9AiTK-6VeuXcycwPHmJPv_OBCJFYOEww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi all.

I can see the PG 13.3 change note about GENERATED ALWAYS AS IDENTITY no
longer being compatible with an explicit NULL specification. However, it
seems that GENERATED BY DEFAULT AS IDENTITY also is no longer compatible
with null:

CREATE TABLE foo
(
id INTEGER NULL GENERATED BY DEFAULT AS IDENTITY
);

Results in:

ERROR: conflicting NULL/NOT NULL declarations for column "id" of table
"foo"

Is this intended? It seems to make sense to allow NULL to be explicitly
inserted into columns whith as GENERATED BY DEFAULT AS IDENTITY. If this is
intended, maybe the release notes should be updated for this.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alex F 2021-05-14 20:12:58 Re: BUG #16833: postgresql 13.1 process crash every hour
Previous Message Peter Geoghegan 2021-05-14 19:25:07 Re: BUG #16833: postgresql 13.1 process crash every hour