Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: jian he <jian.universality@gmail.com>
Cc: Rushabh Lathia <rushabh.lathia@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-03-20T11:07:29Z
Lists: pgsql-hackers
On 2025-Mar-20, jian he wrote:
> as you can see the output of `\d+ notnull_tbl1`
> That means the pg_attribute.attnotnull definition is changed.
That's correct, it changed in that way. I propose for the new docs:
> <row>
> <entry role="catalog_table_entry"><para role="column_definition">
> <structfield>attnotnull</structfield> <type>bool</type>
> </para>
> <para>
> This column has a not-null constraint.
> </para></entry>
> </row>
"This column has a possibly unvalidated not-null constraint". The
description for the new column would say "the not-null constraint for
this column is validated" (or the opposite). My recommendation is to
rename the other column from attinvalidnotnull (Rushabh's proposal) to
"attnotnullvalid" and invert the sense of the boolean. I think that's
less confusing.
Thanks
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"If you want to have good ideas, you must have many ideas. Most of them
will be wrong, and what you have to learn is which ones to throw away."
(Linus Pauling)
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