date_trunc'd timestamp index possible?
D. Duccini <duccini@backpack.com>
From: "D. Duccini" <duccini@backpack.com>
To: pgsql-sql@postgresql.org
Cc: Pgsql-novice <pgsql-novice@postgresql.org>
Date: 2004-09-28T00:14:09Z
Lists: pgsql-hackers, pgsql-novice, 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