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

From Magnus Hagander
Subject Re: Check constraints on non-immutable keys
Date
Msg-id AANLkTilJjP2iUBCcrjTqMKRN9DUKl1jxGWiTYAYKNgzV@mail.gmail.com
Whole thread Raw
In response to Re: Check constraints on non-immutable keys  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Check constraints on non-immutable keys  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Jun 30, 2010 at 16:38, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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.

Really? That sounds strange, but I can't claim to k now the 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

In that case, should we at least throw a warning?


> stupid, but for example the very similar check of "a < now()"
> would be perfectly safe and arguably useful.

Well, things like timezone settings could come in effect there as well...




-- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/


pgsql-hackers by date:

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