Re: Exclusion constraint issue - Mailing list pgsql-general

From Tom Lane
Subject Re: Exclusion constraint issue
Date
Msg-id 28388.1285363335@sss.pgh.pa.us
Whole thread Raw
In response to Exclusion constraint issue  (Eric McKeeth <eldin00@gmail.com>)
Responses Re: Exclusion constraint issue  (David Fetter <david@fetter.org>)
Re: Exclusion constraint issue  (Eric McKeeth <eldin00@gmail.com>)
List pgsql-general
Eric McKeeth <eldin00@gmail.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

pgsql-general by date:

Previous
From: Eric McKeeth
Date:
Subject: Exclusion constraint issue
Next
From: Leif Biberg Kristensen
Date:
Subject: Re: Trade Study on Oracle vs. PostgreSQL