Add ALTER TABLE ... ALTER CONSTRAINT ... SET [NO] INHERIT
Álvaro Herrera <alvherre@alvh.no-ip.org>
Add ALTER TABLE ... ALTER CONSTRAINT ... SET [NO] INHERIT This allows to redefine an existing non-inheritable constraint to be inheritable, which allows to straighten up situations with NO INHERIT constraints so that thay can become normal constraints without having to re-verify existing data. For existing inheritance children this may require creating additional constraints, if they don't exist already. It also allows to do the opposite, if only for symmetry. Author: Suraj Kharage <suraj.kharage@enterprisedb.com> Reviewed-by: jian he <jian.universality@gmail.com> Discussion: https://postgr.es/m/CAF1DzPVfOW6Kk=7SSh7LbneQDJWh=PbJrEC_Wkzc24tHOyQWGg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/alter_table.sgml | modified | +22 −1 |
| src/backend/commands/tablecmds.c | modified | +100 −15 |
| src/backend/parser/gram.y | modified | +28 −0 |
| src/include/nodes/parsenodes.h | modified | +2 −0 |
| src/test/regress/expected/inherit.out | modified | +129 −2 |
| src/test/regress/sql/inherit.sql | modified | +78 −1 |
Documentation touched
Discussion
- Support for NO INHERIT to INHERIT state change with named NOT NULL constraints 20 messages · 2024-11-14 → 2025-03-25