Re: type cast in index

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Linos <info(at)linos(dot)es>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: type cast in index
Date: 2009-06-09 17:58:57
Message-ID: 20090609175857.GH5938@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-06-09 17:59:11 Re: type cast in index
Previous Message Chris Spotts 2009-06-09 17:15:04 Re: type cast in index