Re: [8.1.4] Create index on timestamp fails

Поиск
Список
Период
Сортировка
От Chris Hoover
Тема Re: [8.1.4] Create index on timestamp fails
Дата
Msg-id 1d219a6f0608221202v7e05d14pdf61c29bc2b8756d@mail.gmail.com
обсуждение исходный текст
Ответ на [8.1.4] Create index on timestamp fails  ("Arturo Perez" <aperez@hayesinc.com>)
Список pgsql-general
It appears that 8.1 is stricter on checking the type of function.  Look at your user_tracking function.  It is probably set as volatile.  You need to change it to be immutable.

This should fix the issue.

Chris

On 8/21/06, Arturo Perez <aperez@hayesinc.com> wrote:

Hi all,

Using postgresql 8.1.4....

I have a table with an column:
        entry_date | timestamp with time zone| not null

And when I try to create an index on it like so:
        create index entry_date_idx on user_tracking(date_part('year',entry_date));

I get a
        ERROR: functions in index expression must be marked IMMUTABLE

According to the mailing lists, this has been working since 7.4.  What am I doing wrong?

tia,
arturo


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

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: unique constraint when updating tables
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Queries joining views