Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
jian he <jian.universality@gmail.com>
From: jian he <jian.universality@gmail.com>
To: Rushabh Lathia <rushabh.lathia@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-04-07T12:43:03Z
Lists: pgsql-hackers
Attachments
- v8-0003-not-null-not-valid-miscellous-fix.no-cfbot (application/octet-stream)
hi. CREATE TABLE t (a int, b int); INSERT INTO t VALUES (NULL, 1), (300, 3); ALTER TABLE t ADD CONSTRAINT nn NOT NULL a NOT VALID; -- ok ALTER TABLE t add column c float8 default random(); the last query should not fail. if we want more places use CompactAttribute->attnullability set_attnotnull should also set CompactAttribute->attnullability proactively not waiting CommandCounterIncrement invoke RelationBuildTupleDesc. another reason: CheckNNConstraintFetch only handle "if (!conform->convalidated)" what if the not-null is set conform->convalidated to true, then RelationBuildTupleDesc doesn't set/change CompactAttribute->attnullability at all. attached is all the needed changes after v8-0001, v8-0002, i think.
Commits
-
Allow NOT NULL constraints to be added as NOT VALID
- a379061a22a8 18.0 landed
-
Add missing deparsing of [NO] IDENT to XMLSERIALIZE()
- 984410b92326 18.0 cited
-
backend launchers void * arguments for binary data
- 7202d72787d3 18.0 cited
-
Add pg_constraint rows for not-null constraints
- 14e87ffa5c54 18.0 cited
-
Create the infrastructure for planner support functions.
- 1fb57af92069 12.0 cited
-
Add prokind column, replacing proisagg and proiswindow
- fd1a421fe661 11.0 cited