Re: cast not IMMUTABLE?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: cast not IMMUTABLE?
Дата
Msg-id 20040508162937.S66447@megazone.bigpanda.com
обсуждение исходный текст
Ответ на cast not IMMUTABLE?  (Gaetano Mendola <mendola@bigfoot.com>)
Список pgsql-admin
On Fri, 7 May 2004, Gaetano Mendola wrote:

> Hi all,
> I have a table with ~ 3e+6 rows on it.
>
> I do select on this table in this way:
>
>
> (1) select * from user_logs where login_time::date = now()::date;
>
>
> consider that login_time is a TIMESTAMPTZ with an index on it.
>
> If I use the select in this way:
>
> select * from user_logs where login_time = now();
>
> the the index is used.
>
> I'm trying to use define and index in order to help the query (1):
>
>
> test# create index idx on user_logs ( (login_time::date) );
> ERROR:  functions in index expression must be marked IMMUTABLE
>
>
> why that cast is not considered IMMUTABLE ?

I'd think the conversion of a timestamptz -> date would be dependent on
timezone which would make it not immutable.


В списке pgsql-admin по дате отправления:

Предыдущее
От: jseymour@LinxNet.com (Jim Seymour)
Дата:
Сообщение: Re: FW: Help installing pgSQL 7.4.2 on Solaris 9
Следующее
От: "Armel HERVE"
Дата:
Сообщение: User defined type in C