Disallow changing NO INHERIT status of a not-null constraint

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: 9b581c53418666205938311ef86047aa3c6b741f
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2023-08-29T17:19:24Z
Releases: 17.0
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

Discussion