Re: NOT ENFORCED constraint feature - Mailing list pgsql-hackers

From Amul Sul
Subject Re: NOT ENFORCED constraint feature
Date
Msg-id CAAJ_b95snSr7+q7VCh-7pcriTVtOeEh0Yc7QUWVbC_+RmUNUQg@mail.gmail.com
Whole thread Raw
In response to Re: NOT ENFORCED constraint feature  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
On Sat, Feb 1, 2025 at 8:31 PM jian he <jian.universality@gmail.com> wrote:
>
> [...]
> So the code should only call AlterConstrTriggerDeferrability,
> not call ATExecAlterConstrEnforceability?

Right. Thank you for the report. We need to know whether the
enforceability and/or deferability has actually been set or not before
catalog update.

Have you started working on the ALTER ... CONSTRAINT for the check
constraint? I am thinking to start that. To fix this bug, we have two
options: we could either throw an error as we don’t currently support
altering enforceability and deferability together (which I’m not a fan
of), or we could refactor the ALTER ... CONSTRAINT code to include
more information which would allow us to perform the appropriate
update action during the execution stage, and it would also help with
altering check constraints.

Regards,
Amul



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] Fix incorrect range in pg_regress comment
Next
From: Amit Kapila
Date:
Subject: Re: Fix assert failure when decoding XLOG_PARAMETER_CHANGE on primary