Re: type cast in index - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: type cast in index
Date
Msg-id 20090609175857.GH5938@alvh.no-ip.org
Whole thread Raw
In response to type cast in index  (Linos <info@linos.es>)
List pgsql-general
Linos escribió:

> CREATE INDEX fecha_creacion_ordtrab ON orden_trabajo_cabecera USING btree
> ((time_stamp_creacion::date));
>
> but in my postgresql 8.3 version i get this error:
>
> ERROR:  functions in index expression must be marked IMMUTABLE

You can make it work by adding an AT TIME ZONE 'UTC' specification,
which will cause it to be turned into a plain timestamp (without tz).

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: "Chris Spotts"
Date:
Subject: Re: type cast in index
Next
From: Tom Lane
Date:
Subject: Re: type cast in index