From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Prevent setting a column as identity if its not-null constraint
Date: Mon, 03 Nov 2025 14:59:08 +0000
Message-ID: <E1vFw1U-004qdd-0A@gemulon.postgresql.org> (raw)
Prevent setting a column as identity if its not-null constraint is invalid
We don't allow null values to appear in identity-generated columns in
other ways, so we shouldn't let unvalidated not-null constraints do it
either. Oversight in commit a379061a22a8.
Author: jian he <jian.universality@gmail.com>
Backpatch-through: 18
Discussion: https://postgr.es/m/CACJufxGQM_+vZoYJMaRoZfNyV=L2jxosjv_0TLAScbuLJXWRfQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/cf8be022538937fe9fe22de776fb8cfe6460a784
Modified Files
--------------
src/backend/commands/tablecmds.c | 25 +++++++++++++++++++++++++
src/test/regress/expected/constraints.out | 4 ++++
src/test/regress/sql/constraints.sql | 3 +++
3 files changed, 32 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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Prevent setting a column as identity if its not-null constraint
In-Reply-To: <E1vFw1U-004qdd-0A@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