Re: date_trunc on date is immutable? - Mailing list pgsql-general

From Scott Marlowe
Subject Re: date_trunc on date is immutable?
Date
Msg-id dcc563d10912241656t61c23a63s1c4c7de71e67facf@mail.gmail.com
Whole thread Raw
In response to date_trunc on date is immutable?  (Kian Wright <kian.wright@senioreducators.com>)
Responses Re: date_trunc on date is immutable?  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
On Thu, Dec 24, 2009 at 4:36 PM, Kian Wright
<kian.wright@senioreducators.com> wrote:
> I'm trying to create an index on the month and year of a date field (in
> 8.3), and I'm getting the "functions in index expression must be marked
> IMMUTABLE" error message.

If applied to a timestamp, it is immutable.  If it's a timestamp with
timezone it's not, because the timezone can change, which would change
the index.

pgsql-general by date:

Previous
From: Kian Wright
Date:
Subject: date_trunc on date is immutable?
Next
From: Scott Marlowe
Date:
Subject: Re: How to add month.year column validation