Matthew Engelbert <mje1975@yahoo.com> writes:
> CREATE INDEX ecn_sales_index_day on ecn_sales (extract(DOY FROM tv_time));
> ERROR: syntax error at or near "(" at character 55
Assuming you're using 7.4, put an extra pair of parens there:
CREATE INDEX ecn_sales_index_day on ecn_sales ((extract(DOY FROM tv_time)));
In earlier PG versions you'll need a wrapper function around the extract
call. It looks like a function, but it isn't quite one because of the
weird syntax.
regards, tom lane