Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
To: Rushabh Lathia <rushabh.lathia@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
jian he <jian.universality@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-03-20T12:19:57Z
Lists: pgsql-hackers
On Thu, Mar 20, 2025 at 3:25 PM Rushabh Lathia <rushabh.lathia@gmail.com> wrote: > > Hi Alvaro, > > Thank you for the offline discussion. > > As we all agree, changing the attnotnull datatype would not be a good idea since it is > a commonly used catalog column, and many applications and extensions depend on it. > > Attached is another version of the patch (WIP), where I have introduced a new catalog column, > pg_attribute.attinvalidnotnull (boolean). This column will default to FALSE but will be set to TRUE > when an INVALID NOT NULL constraint is created. With this approach, we can avoid performing > extra scans on the catalog table to identify INVALID NOT NULL constraints, ensuring there is no > performance impact. > > Also updated the pg_dump implementation patch and attaching the same here. > These patches do not address comments discussed in [1]. Since there was a change in design, I am assuming that those will be addressed once the design change is accepted. [1] https://www.postgresql.org/message-id/202503121157.3zabg6m3anwp@alvherre.pgsql -- Best Wishes, Ashutosh Bapat
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