On Wed, Dec 3, 2014 at 12:44:34PM -0500, Tom Lane wrote:
> Flavio Henrique Araque Gurgel <fhagur@gmail.com> writes:
> > 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
>
> > Who is wrong, parser or documentation (or myself)?
>
> Documentation, evidently: a look at the grammar shows that IF EXISTS has
> been implemented only for a rather haphazard subset of ALTER ... RENAME
> cases, and this isn't one of them.
Rather than fixing the docs, I implemented the feature --- patch
attached.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ Everyone has their own god. +