Re: Exclusion constraint issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Eric McKeeth <eldin00(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Exclusion constraint issue
Date: 2010-09-24 21:22:15
Message-ID: 28388.1285363335@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Eric McKeeth <eldin00(at)gmail(dot)com> writes:
> why would I get the following error, since the period() function is in fact
> declared as immutable?

> test=# ALTER TABLE test3 ADD exclude using
> gist(period(effect_date::timestamptz, expire_date::timestamptz) with && );
> ERROR: functions in index expression must be marked IMMUTABLE

period() might be immutable, but those casts from date to timestamptz
are not, because they depend on the TimeZone parameter.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leif Biberg Kristensen 2010-09-24 21:38:18 Re: Trade Study on Oracle vs. PostgreSQL
Previous Message Eric McKeeth 2010-09-24 21:09:29 Exclusion constraint issue