ALTER TABLE documentation or parser bug - Mailing list pgsql-bugs

From Flavio Henrique Araque Gurgel
Subject ALTER TABLE documentation or parser bug
Date
Msg-id 547F462E.8090001@gmail.com
Whole thread Raw
Responses Re: ALTER TABLE documentation or parser bug
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #12126: Empty tsvector as output ofto_tsvector function
Next
From: Tom Lane
Date:
Subject: Re: ALTER TABLE documentation or parser bug