Re: creating index using function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: creating index using function
Дата
Msg-id 594.1100913554@sss.pgh.pa.us
обсуждение исходный текст
Ответ на creating index using function  (Matthew Engelbert <mje1975@yahoo.com>)
Список pgsql-novice
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

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

Предыдущее
От: Matthew Engelbert
Дата:
Сообщение: creating index using function
Следующее
От: "Dzial Techniczny"
Дата:
Сообщение: [OT] apache auth with postgres?