Re: date is not immutable ? - Mailing list pgsql-admin

From Tom Lane
Subject Re: date is not immutable ?
Date
Msg-id 29517.1047505618@sss.pgh.pa.us
Whole thread Raw
In response to date is not immutable ?  ("Gaetano Mendola" <mendola@bigfoot.com>)
List pgsql-admin
"Gaetano Mendola" <mendola@bigfoot.com> writes:
> I'm trying to create an index on a timestamptz field just extracting the
> date:
> # create index idx_user_logs_login_time_date on user_logs (
> date(login_time) );
> ERROR:  DefineIndex: index function must be marked IMMUTABLE

> why date is not marked immutable ?

Because the conversion depends on your timezone setting.

            regards, tom lane

pgsql-admin by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: OOT-Does PostgreSQL has commercial level.
Next
From: P G
Date:
Subject: I cannot get the db to initialize. Please help.