Re: Check constraints on non-immutable keys

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Check constraints on non-immutable keys
Date: 2010-06-30 14:38:31
Message-ID: 9857.1277908711@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2010-06-30 14:40:58 Re: Check constraints on non-immutable keys
Previous Message Magnus Hagander 2010-06-30 14:32:35 Re: Keepalives win32