Re: date_trunc on date is immutable?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Kian Wright <kian(dot)wright(at)senioreducators(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: date_trunc on date is immutable?
Date: 2009-12-25 00:56:26
Message-ID: dcc563d10912241656t61c23a63s1c4c7de71e67facf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Dec 24, 2009 at 4:36 PM, Kian Wright
<kian(dot)wright(at)senioreducators(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-12-25 00:59:26 Re: How to add month.year column validation
Previous Message Adrian Klaver 2009-12-25 00:05:16 Re: How to add month.year column validation