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-05 19:23:30
Message-ID: 202509051923.n4xc5vthqyhu@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Sep-04, Álvaro Herrera wrote:

> On 2025-Sep-04, jian he wrote:

> > + else if (notenforced)
> > + {
> > + /*
> > + * We can't use ATExecSetNotNull here because it adds an enforced
> > + * not-null constraint, but here we only want a non-enforced one.
> > + */
>
> Umm, wouldn't it make more sense to modify ATExecSetNotNull() so that it
> does what we want? This seems hackish.

BTW while you're at that, it might make sense to allow commands like
ALTER TABLE foo ALTER col1 SET NOT NULL NOT VALID
ALTER TABLE foo ALTER col1 SET NOT NULL NOT ENFORCED

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"La verdad no siempre es bonita, pero el hambre de ella sí"

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nazir Bilal Yavuz 2025-09-05 20:12:27 Re: Differential Code Coverage report for Postgres
Previous Message Álvaro Herrera 2025-09-05 19:14:08 Re: Differential Code Coverage report for Postgres