postgresql/src
Fujii Masao d8b5d87e54 Prevent setting NO INHERIT on partitioned NOT NULL constraints
The documentation states that NOT NULL constraints on partitioned tables
are always inherited by all partitions, and therefore cannot be declared
NO INHERIT. While a check already existed to reject creating such
constraints with NO INHERIT, previously the same check was missing for
ALTER TABLE ... ALTER CONSTRAINT ... NO INHERIT.

This commit adds the missing check so that attempting to set NO INHERIT
on a partitioned NOT NULL constraint now fails.

Backpatch to v18, where ALTER TABLE ... ALTER CONSTRAINT ... [NO] INHERIT
was added.

Author: Andreas Karlsson <andreas@proxel.se>
Reviewed-by: Jim Jones <jim.jones@uni-muenster.de>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/ecc985ad-6ec1-4094-a315-317943ca5f3f@proxel.se
Backpatch-through: 18
2026-05-22 23:59:04 +09:00
..
backend Prevent setting NO INHERIT on partitioned NOT NULL constraints 2026-05-22 23:59:04 +09:00
bin pg_recvlogical: Add tests for output file permissions 2026-05-20 16:01:56 +09:00
common pg_test_timing: Show additional TSC clock source debug info 2026-05-16 11:51:34 -04:00
fe_utils Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
include Remove support for 8 byte tear free read/write on 32-bit 2026-05-18 08:59:59 -07:00
interfaces Pre-beta mechanical code beautification, step 2: run pgperltidy. 2026-05-13 10:37:42 -04:00
makefiles Add CONCURRENTLY option to REPACK 2026-04-06 21:55:08 +02:00
pl Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
port pg_test_timing: Show additional TSC clock source debug info 2026-05-16 11:51:34 -04:00
template Switch the semaphore API on Solaris to unnamed POSIX. 2026-03-14 14:10:32 -04:00
test Prevent setting NO INHERIT on partitioned NOT NULL constraints 2026-05-22 23:59:04 +09:00
timezone Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
tools pg_test_timing: Show additional TSC clock source debug info 2026-05-16 11:51:34 -04:00
tutorial Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
.gitignore
DEVELOPERS
Makefile Add CONCURRENTLY option to REPACK 2026-04-06 21:55:08 +02:00
Makefile.global.in Update Unicode data to CLDR 48.2 2026-04-13 11:13:36 +02:00
Makefile.shlib Restore AIX support. 2026-02-23 13:34:22 -05:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00