Disallow changing NO INHERIT status of a not-null constraint
Alvaro Herrera <alvherre@alvh.no-ip.org>
Disallow changing NO INHERIT status of a not-null constraint It makes no sense to add a NO INHERIT not-null constraint to a child table that already has one in that column inherited from its parent. Disallow that, and add tests for the relevant cases. Per complaint from Kyotaro Horiguchi. I also used part of his proposed patch. Co-authored-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Co-authored-by: Álvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://postgr.es/m/20230828.161658.1184657435220765047.horikyota.ntt@gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/heap.c | modified | +12 −1 |
| src/backend/catalog/pg_constraint.c | modified | +18 −4 |
| src/include/catalog/pg_constraint.h | modified | +2 −1 |
| src/test/regress/expected/inherit.out | modified | +9 −0 |
| src/test/regress/sql/inherit.sql | modified | +6 −0 |
Discussion
- Strange presentaion related to inheritance in \d+ 5 messages · 2023-08-28 → 2023-08-30