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

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: pavel(dot)boev(at)invitae(dot)com, 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-03-04 14:22:55
Message-ID: 7c02b352-a2e4-e71a-ae69-7e410daf5774@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 3/4/21 5:13 AM, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference: 16913
> Logged by: Pavel Boev
> Email address: pavel(dot)boev(at)invitae(dot)com
> PostgreSQL version: 13.2
> Operating system: Debian 8.3.0-6
> Description:
>
> I noticed that nullability of columns having GENERATED AS IDENTITY option is
> affected by the order of NULL option, so the next query will create a
> "my_table" table having non-nullable column "generated":
>
> create table my_table (
> generated integer null generated by default as identity,
> data text not null
> );
>
> Whereas the following query will create a "my_table" table having nullable
> column "generated":
>
> create table my_table (
> generated integer generated by default as identity null,
> data text not null
> );
>
> I noticed the issue appeared in postgres 13.2, however folks say that they
> bug affects versions 10, 11 and 12 as well.

I can confirm this bug. Attached is a patch to prevent it.
--
Vik Fearing

Attachment Content-Type Size
null_identity.diff text/x-patch 4.0 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2021-03-04 15:01:46 Re: BUG #16912: pg_dump 11 does not respect --quote-all-identifiers within function bodies
Previous Message Euler Taveira 2021-03-04 14:18:44 Re: BUG #16915: use psql have error "could not change directory to "/root": Permission denied"