ALTER TABLE documentation or parser bug

Поиск
Список
Период
Сортировка
От Flavio Henrique Araque Gurgel
Тема ALTER TABLE documentation or parser bug
Дата
Msg-id 547F462E.8090001@gmail.com
обсуждение исходный текст
Ответы Re: ALTER TABLE documentation or parser bug
Список pgsql-bugs
Hello all

In the documentation in:
http://www.postgresql.org/docs/current/static/sql-altertable.html

It says that, to rename a constraint, we can use:

ALTER TABLE [ IF EXISTS ] [ ONLY ] name [ * ]
     RENAME CONSTRAINT constraint_name TO new_constraint_name

With the optionel "IF EXISTS".

When trying in a 9.3.5 server:
ALTER TABLE IF EXISTS foo RENAME CONSTRAINT fk_foo_bar TO fk_foo_din;

It returns an error:
ERROR:  syntax error at or near "CONSTRAINT"
LINE 1: ALTER TABLE IF EXISTS shop rename CONSTRAINT fk_foo_bar...

If I try without "IF EXISTS" it works as expected.

Who is wrong, parser or documentation (or myself)?

Thanks
Flavio Gurgel

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #12126: Empty tsvector as output ofto_tsvector function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ALTER TABLE documentation or parser bug