pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Prevent setting a column as identity if its not-null constraint
2+ messages / 1 participants
[nested] [flat]

* pgsql: Prevent setting a column as identity if its not-null constraint
@ 2025-11-03 14:59 Álvaro Herrera <alvherre@kurilemu.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Álvaro Herrera @ 2025-11-03 14:59 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Prevent setting a column as identity if its not-null constraint
@ 2025-11-03 14:59 Álvaro Herrera <alvherre@kurilemu.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Álvaro Herrera @ 2025-11-03 14:59 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d9ffc27291fda0041db4f1e9c74ab1148e4b04a8

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(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-11-03 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-11-03 14:59 pgsql: Prevent setting a column as identity if its not-null constraint Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 14:59 pgsql: Prevent setting a column as identity if its not-null constraint Álvaro Herrera <alvherre@kurilemu.de>

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