Re: CHECK Constraint Deferrable - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: CHECK Constraint Deferrable
Date
Msg-id CAKFQuwYYh+S9sK4tW+sZP4Ky9OivBcayJJGSE-dXEr08ww7v7g@mail.gmail.com
Whole thread Raw
In response to Re: CHECK Constraint Deferrable  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Oct 2, 2023 at 12:25 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Himanshu Upadhyaya <upadhyaya.himanshu@gmail.com> writes:
> V3 patch attached.

Sorry for not weighing in on this before, but ... is this a feature
we want at all?  We are very clear in the existing docs that CHECK
conditions must be immutable [1], and that's not something we can
easily relax because if they are not then it's unclear when we need
to recheck them to ensure they stay satisfied.

Agreed.  I'm not sold on conforming to the standard being an appropriate ideal here.  Either we already don't because our check constraints are immutable, or I'm missing what use case the committee had in mind when they designed this feature.  In any case, its absence doesn't seem that sorely missed, and the OP's only actual example would require relaxing the immutable property which I disagree with.  We have deferrable triggers to serve that posited use case.

David J.

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: pg16: XX000: could not find pathkey item to sort
Next
From: "Karl O. Pinc"
Date:
Subject: Re: Various small doc improvements; plpgsql, schemas, permissions, oidvector