Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group