Re: Prevent setting NO INHERIT on partitioned not-null constraints

Andreas Karlsson <andreas@proxel.se>

From: Andreas Karlsson <andreas@proxel.se>
To: Jim Jones <jim.jones@uni-muenster.de>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-05-21T21:22:31Z
Lists: pgsql-hackers

Attachments

On 5/21/26 5:01 PM, Jim Jones wrote:
> The errcode is most likely wrong:
> 
> ERRCODE_WRONG_OBJECT_TYPE -> ERRCODE_FEATURE_NOT_SUPPORTED
> 
> At least it is inconsistent with an equivalent check in parse_utilcmd.c:
> 
> if (cxt->ispartitioned && constraint->is_no_inherit)
>    ereport(ERROR,
> 	  errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
>            errmsg("not-null constraints on partitioned tables cannot be
> NO INHERIT"));

Thanks, that was a copy pasto. Version 2 is attached.

-- 
Andreas Karlsson
Percona