Re: cataloguing NOT NULL constraints - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id 5b4cd32f-1d5b-c080-c688-31736bbcd739@gmail.com
Whole thread Raw
In response to Re: cataloguing NOT NULL constraints  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: cataloguing NOT NULL constraints
List pgsql-hackers
Hello Alvaro,

18.04.2024 16:39, Alvaro Herrera wrote:
> I have pushed a fix which should hopefully fix this problem
> (d9f686a72e).  Please give this a look.  Thanks for reporting the issue.

Please look at an assertion failure, introduced with d9f686a72:
CREATE TABLE t(a int, NOT NULL a NO INHERIT);
CREATE TABLE t2() INHERITS (t);

ALTER TABLE t ADD CONSTRAINT nna NOT NULL a;
TRAP: failed Assert("lockmode != NoLock || IsBootstrapProcessingMode() || CheckRelationLockedByMe(r, AccessShareLock, 
true)"), File: "relation.c", Line: 67, PID: 2980258

On d9f686a72~1 this script results in:
ERROR:  cannot change NO INHERIT status of inherited NOT NULL constraint "t_a_not_null" on relation "t"

Best regards,
Alexander



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Next
From: Justin Pryzby
Date:
Subject: Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL