Re: NOT NULL NOT ENFORCED - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: NOT NULL NOT ENFORCED
Date
Msg-id 202509081201.5mxbrtptp6ko@alvherre.pgsql
Whole thread Raw
In response to Re: NOT NULL NOT ENFORCED  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
On 2025-Sep-08, jian he wrote:

> set pg_attribute.attnotnull to true for not-valid not-null is still
> useful for INSERT/UPDATE.
> set pg_attribute.attnotnull to true for not-enforced not-null
> constraints doesn't have real benefits, IMHO.

Yeah, you might be right about this actually.  What we wanted attnotnull
to be set for, as I recall, was so that generic apps could alert the
user that an insert that tries to put a NULL value in that column would
not work, without having to actually execute it.  With a non-enforced


-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"The important things in the world are problems with society that we don't
understand at all. The machines will become more complicated but they won't
be more complicated than the societies that run them."    (Freeman Dyson)



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: new warnings with clang-21 / how const is Datum
Next
From: Shayon Mukherjee
Date:
Subject: Re: [PATCH] Proposal to Enable/Disable Index using ALTER INDEX