Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
Rushabh Lathia <rushabh.lathia@gmail.com>
From: Rushabh Lathia <rushabh.lathia@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2025-02-06T12:38:46Z
Lists: pgsql-hackers
Attachments
- 0003-Support-pg_dump-to-dump-NOT-VALID-named-NOT-NULL-con.patch (application/octet-stream) patch 0003
- 0002-Support-NOT-VALID-and-VALIDATE-CONSTRAINT-for-named-.patch (application/octet-stream) patch 0002
- 0001-Convert-pg_attribut.attnotnull-to-char-type.patch (application/octet-stream) patch 0001
Hi, Commit 14e87ffa5c543b5f30ead7413084c25f7735039f <https://github.com/postgres/postgres/commit/14e87ffa5c543b5f30ead7413084c25f7735039f> added the support for named NOT NULL constraints. We can now support the NOT VALID/VALID named NOT NULL constraints. This patch supports the NOT VALID and VALIDATE CONSTRAINT for name NOT NULL constraints. In order to achieve this patch, 1) Converted the pg_attribute.attnotnull to CHAR type, so that it can hold the INVALID flag for the constraint. 2) Added the support for NOT VALID as well as VALIDATE CONSTRAINT support. 3) Support for pg_dump, where we now dumping the INVALID NOT NULL as separate from table schemes, just like CHECK Constraints. 4) Added related testcases. Attaching the patch here. Thanks Alvaro for your offline help and support for this feature. Thanks Rushabh Lathia www.EnterpriseDB.com
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