From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Forbid marking an identity column as nullable.
Date: Fri, 12 Mar 2021 16:08:55 +0000
Message-ID: <E1lKkLP-0004ne-GQ@gemulon.postgresql.org> (raw)
Forbid marking an identity column as nullable.
GENERATED ALWAYS AS IDENTITY implies NOT NULL, but the code failed
to complain if you overrode that with "GENERATED ALWAYS AS IDENTITY
NULL". One might think the old behavior was a feature, but it was
inconsistent because the outcome varied depending on the order of
the clauses, so it seems to have been just an oversight.
Per bug #16913 from Pavel Boev. Back-patch to v10 where identity
columns were introduced.
Vik Fearing (minor tweaks by me)
Discussion: https://postgr.es/m/16913-3b5198410f67d8c6@postgresql.org
Branch
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/e7f7950f6741a799bdf1dc3d2dbcb85e1b0a3c8c
Modified Files
--------------
doc/src/sgml/ref/create_table.sgml | 1 +
src/backend/parser/parse_utilcmd.c | 10 ++++++++++
src/test/regress/expected/identity.out | 13 +++++++++++++
src/test/regress/sql/identity.sql | 9 +++++++++
4 files changed, 33 insertions(+)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Forbid marking an identity column as nullable.
In-Reply-To: <E1lKkLP-0004ne-GQ@gemulon.postgresql.org>
References: <E1lKkLP-0004ne-GQ@gemulon.postgresql.org>
* 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