Re: NOT NULL NOT ENFORCED
Álvaro Herrera <alvherre@kurilemu.de>
From: Álvaro Herrera <alvherre@kurilemu.de>
To: jian he <jian.universality@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-09-08T12:01:42Z
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)
Commits
-
Fix CREATE TABLE LIKE with not-valid check constraint
- 33eec809402b 19 (unreleased) landed
- 21fdc37d219a 18.0 landed
-
Add support for NOT ENFORCED in CHECK constraints
- ca87c415e2fc 18.0 cited