Re: [GENERAL] ERROR: functions in index expression must be marked IMMUTABLE

Поиск
Список
Период
Сортировка
От Geoff Winkless
Тема Re: [GENERAL] ERROR: functions in index expression must be marked IMMUTABLE
Дата
Msg-id CAEzk6fdvUWfyignuG548pwSmQG-05szzn_Kf7mKYrb-hOVu8mg@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] ERROR: functions in index expression must be marked IMMUTABLE  ("Sven R. Kunze" <srkunze@mail.de>)
Ответы Re: [GENERAL] ERROR: functions in index expression must be markedIMMUTABLE
Список pgsql-general
On 26 February 2017 at 10:09, Sven R. Kunze <srkunze@mail.de> wrote:
>>># create index docs_birthdate_idx ON docs using btree (((meta->>'birthdate')::date));
ERROR:  functions in index expression must be marked IMMUTABLE

So, what is the problem here?

​Date functions are inherently not immutable because of timezones. Your solution of using to_timestamp doesn't help because it automatically returns a value in WITH TIMESTAMP. Do you get anywhere by using "::timestamp without time zone" instead, as suggested here?


Geoff

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