date_trunc'd timestamp index possible?

Поиск
Список
Период
Сортировка
От D. Duccini
Тема date_trunc'd timestamp index possible?
Дата
Msg-id Pine.GSO.4.10.10409271910480.22691-100000@solarwind
обсуждение исходный текст
Ответ на Adventures in PostgreSQL  ("Josh Berkus" <josh@agliodbs.com>)
Список pgsql-sql
I'm trying to create a index from a timestamp+tz field and want the index
to be date_trunc'd down to just the date

when i try to do a

create idxfoo on foo (date(footime));

i get a

ERROR:  DefineIndex: index function must be marked IMMUTABLE

and it chokes on when i try to use the date_trunc() function as well

create idxfoo on foo (date_trunc('day',footime));

ERROR:  parser: parse error at or near "'day'" at character 53

Any suggestions/workarounds (other than creating additional date-only
columns in the schema and indexing those???)

-d


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

Предыдущее
От: Dag Gullberg
Дата:
Сообщение: Concurrency problem
Следующее
От: sreejith s
Дата:
Сообщение: Postgres Doubt