Re: BUG #16913: GENERATED AS IDENTITY column nullability is affected by order of column properties - Mailing list pgsql-bugs

From Shay Rojansky
Subject Re: BUG #16913: GENERATED AS IDENTITY column nullability is affected by order of column properties
Date
Msg-id CADT4RqAwD3A=RvGiQU9AiTK-6VeuXcycwPHmJPv_OBCJFYOEww@mail.gmail.com
Whole thread Raw
Responses Re: BUG #16913: GENERATED AS IDENTITY column nullability is affected by order of column properties  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.

pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #16833: postgresql 13.1 process crash every hour
Next
From: Alex F
Date:
Subject: Re: BUG #16833: postgresql 13.1 process crash every hour