Re: Check constraints on non-immutable keys - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Check constraints on non-immutable keys
Date
Msg-id 9857.1277908711@sss.pgh.pa.us
Whole thread Raw
In response to Check constraints on non-immutable keys  (Magnus Hagander <magnus@hagander.net>)
Responses Re: Check constraints on non-immutable keys  (Magnus Hagander <magnus@hagander.net>)
Re: Check constraints on non-immutable keys  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> Shouldn't we disallow anything that's not IMMUTABLE in a check constraint?

I think you'd get too many howls of pain ... also, such a restriction is
likely contrary to SQL spec.

The example seems to me to be in the category of "so don't do that"
rather than something that we need to save users from.  Yes, it's
stupid, but for example the very similar check of "a < now()"
would be perfectly safe and arguably useful.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Keepalives win32
Next
From: Magnus Hagander
Date:
Subject: Re: Check constraints on non-immutable keys