Re: BUG #8211: Syntax error when creating index on expression

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #8211: Syntax error when creating index on expression
Дата
Msg-id 25396.1370450106@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #8211: Syntax error when creating index on expression  (acizov@gmail.com)
Список pgsql-bugs
acizov@gmail.com writes:
> CREATE INDEX heuristic ON foos (1 / (a + b))
> causes:
> ERROR:  syntax error at or near "1"

This is not a bug.  You need an extra pair of parentheses around
the expression, ie

CREATE INDEX heuristic ON foos ((1 / (a + b)))

http://www.postgresql.org/docs/9.2/static/sql-createindex.html
points this out both in the syntax diagram and the text.

            regards, tom lane

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

Предыдущее
От: bricklen
Дата:
Сообщение: Re: BUG #8211: Syntax error when creating index on expression
Следующее
От: geoff.montee@gmail.com
Дата:
Сообщение: BUG #8212: Feature request: View original value of current_user in function with SECURITY DEFINER set