Prevent setting a column as identity if its not-null constraint is invalid
Álvaro Herrera <alvherre@kurilemu.de>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/tablecmds.c | modified | +25 −0 |
| src/test/regress/expected/constraints.out | modified | +4 −0 |
| src/test/regress/sql/constraints.sql | modified | +3 −0 |
Discussion
- fix NOT VALID NOT NULL with ALTER COLUMN SET IDENTITY 3 messages · 2025-09-03 → 2025-11-03