Re: NOT NULL NOT ENFORCED

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: NOT NULL NOT ENFORCED
Date: 2025-09-08 12:01:42
Message-ID: 202509081201.5mxbrtptp6ko@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shayon Mukherjee 2025-09-08 12:15:05 Re: [PATCH] Proposal to Enable/Disable Index using ALTER INDEX
Previous Message Peter Eisentraut 2025-09-08 12:01:20 Re: new warnings with clang-21 / how const is Datum