Re: alter check constraint enforceability

From: Cédric Villemain <cedric(dot)villemain(at)data-bene(dot)io>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Amul Sul <sulamul(at)gmail(dot)com>, Robert Treat <rob(at)xzilla(dot)net>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: alter check constraint enforceability
Date: 2026-02-09 12:58:00
Message-ID: f072b63e-8e8a-4d60-bc84-3af85d69a1db@data-bene.io
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Mon, Feb 9, 2026 at 5:55 PM Cédric Villemain
> <cedric(dot)villemain(at)data-bene(dot)io> wrote:
>>
>> I have some questions/comments (no change on status, I didn't test)
>>
>> - FK are constraint triggers, does it makes sense to align
>> "ATExecAlterFKConstrEnforceability" renaming with other functions like
>> "AlterConstrTriggerDeferrability" ?
>>
>
> do you mean changing
> ATExecAlterConstrDeferrability
> to
> ATExecAlterFKConstrDeferrability
> ?

I mean to keep the ConstrTrigger part in the name, in the idea that it's
the same feature (FK are "just" specialized constraints triggers IIUC).

> If so, it makes sense and also improves readability, IMO.
> However, since only FK supports changing deferrability—and we are not
> modifying deferrability here,
> the incentive for this renaming change is kind of lower.

sure.

>> - I also wonder if it makes sense to manage NOT NULL together with
>> CHECK, like in ATAddCheckNNConstraint.... ?
>>
> See ATExecAlterConstraintInternal.
> We do not support changing enforceability of NOT NULL, since NOT NULL
> NOT ENFORCED is not supported.
> I do have a patch for NOT NULL NOT ENFORCED,
> https://commitfest.postgresql.org/patch/6029

Ah great, tks.

I'll check your CF entries instead of adding noise here (I was wondering
if already had a patch to cleanup processCASbits() in gram.y).

--
Cédric Villemain +33 6 20 30 22 52
https://www.Data-Bene.io
PostgreSQL Support, Expertise, Training, R&D

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2026-02-09 12:58:35 Re: log_min_messages per backend type
Previous Message Alvaro Herrera 2026-02-09 12:50:03 Re: log_min_messages per backend type