Re: Subqueries in Check() -- Still Intentionally Omitted? - Mailing list pgsql-general

From Tom Lane
Subject Re: Subqueries in Check() -- Still Intentionally Omitted?
Date
Msg-id 8893.1220401564@sss.pgh.pa.us
Whole thread Raw
In response to Re: Subqueries in Check() -- Still Intentionally Omitted?  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-general
Jeff Davis <pgsql@j-davis.com> writes:
> On Tue, 2008-09-02 at 19:22 -0400, Tom Lane wrote:
>> Jeff Davis <pgsql@j-davis.com> writes:
>>> My question is not why don't we allow subqueries in CHECK, my question
>>> is why do we allow stable/volatile functions?
>>
>> Historically we've allowed it,

> I suppose this means that we're already treating any CHECK constraint as
> immutable anyway, e.g. for constraint_exclusion?

I think the constraint_exclusion code does check for immutability before
assuming it can deduce exclusion.  But the ordinary use of CHECK just
assumes it only needs to evaluate the check at tuple insertion.

            regards, tom lane

pgsql-general by date:

Previous
From: "Richard Broersma"
Date:
Subject: Re: Subqueries in Check() -- Still Intentionally Omitted?
Next
From: Robert Treat
Date:
Subject: Re: Oracle and Postgresql