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

From Álvaro Herrera
Subject Re: NOT NULL NOT ENFORCED
Date
Msg-id 202509051923.n4xc5vthqyhu@alvherre.pgsql
Whole thread Raw
In response to Re: NOT NULL NOT ENFORCED  (Álvaro Herrera <alvherre@kurilemu.de>)
List 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í"



pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: Differential Code Coverage report for Postgres
Next
From: Nazir Bilal Yavuz
Date:
Subject: Re: Differential Code Coverage report for Postgres