I'm trying to index on a part of a datetime field. I tried the following statement : create index ns_dt1_idx on netstats (date_trunc('day',NS_DATE) datetime_ops); It doesn't work and I get : ERROR: parser: parse error at or near "'" Any idea ?