Re: BUG #16913: GENERATED AS IDENTITY column nullability is affected by order of column properties
Amit Langote <amitlangote09@gmail.com>
From: Amit Langote <amitlangote09@gmail.com>
To: Vik Fearing <vik@postgresfriends.org>
Cc: pavel.boev@invitae.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-03-12T12:59:14Z
Lists: pgsql-bugs
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. There seems to be an empty line added at the end, which git diff --check flags: $ git diff --check src/test/regress/sql/identity.sql:356: new blank line at EOF. +-- Identity columns must be NOT NULL (cf bug #16913) + +CREATE TABLE itest15 (id integer GENERATED ALWAYS AS IDENTITY NULL); -- fail +CREATE TABLE itest15 (id integer NULL GENERATED ALWAYS AS IDENTITY); -- fail +CREATE TABLE itest15 (id integer GENERATED ALWAYS AS IDENTITY NOT NULL); DROP TABLE itest15; +CREATE TABLE itest15 (id integer NOT NULL GENERATED ALWAYS AS IDENTITY); DROP TABLE itest15; + -- Amit Langote EDB: http://www.enterprisedb.com
Commits
-
Doc: correct erroneous entry in this week's minor release notes.
- e5f982156952 10.18 landed
- 6a4c07156802 13.4 landed
- 0a536004b7d9 12.8 landed
- 037cc13f413d 11.13 landed
-
Forbid marking an identity column as nullable.
- f52c5d6749a6 14.0 landed
- e7f7950f6741 12.7 landed
- e5794cd59394 10.17 landed
- 8a2297776667 13.3 landed
- 6c34f186c4c6 11.12 landed