date_trunc'd timestamp index possible? - Mailing list pgsql-sql

From D. Duccini
Subject date_trunc'd timestamp index possible?
Date
Msg-id Pine.GSO.4.10.10409271910480.22691-100000@solarwind
Whole thread Raw
In response to Adventures in PostgreSQL  ("Josh Berkus" <josh@agliodbs.com>)
List 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 by date:

Previous
From: Dag Gullberg
Date:
Subject: Concurrency problem
Next
From: sreejith s
Date:
Subject: Postgres Doubt