pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Flavio Henrique Araque Gurgel <fhagur@gmail.com>
To: pgsql-bugs@postgresql.org
Cc: osalm@mirakl.com
Subject: ALTER TABLE documentation or parser bug
Date: Wed, 03 Dec 2014 18:19:42 +0100
Message-ID: <547F462E.8090001@gmail.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (7+ messages)  latest in thread

Message-ID: <547F462E.8090001@gmail.com>
Permalink:  ../547F462E.8090001@gmail.com/
Also on:    postgresql.org/message-id/547F462E.8090001@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: fhagur@gmail.com, osalm@mirakl.com
  Subject: Re: ALTER TABLE documentation or parser bug
  In-Reply-To: <547F462E.8090001@gmail.com>
  References: <547F462E.8090001@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox