Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XwDai-0008Qk-3O for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Dec 2014 17:19:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XwDah-0006Co-Kt for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Dec 2014 17:19:51 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XwDag-0006Cg-Jq for pgsql-bugs@postgresql.org; Wed, 03 Dec 2014 17:19:50 +0000 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XwDad-0003FW-7K for pgsql-bugs@postgresql.org; Wed, 03 Dec 2014 17:19:48 +0000 Received: by mail-wi0-f182.google.com with SMTP id h11so25203108wiw.3 for ; Wed, 03 Dec 2014 09:19:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=d+OkJau82lv3wG13e3U3sEEPkl43V+rAV++n8UbkKU8=; b=h4dXjtMIdUqr+A/5wwosffYA9lYZ9ncH71t0sgNkeqlkaoucNJ75LJlz70PBw+l0qJ TcTLA++9JegLPxUcZzEB6N/zNfvteAj57G98QPZMDDeRx/rES2zD/MvY7Nb0wyC0vQ5z miw0bDnxlPO5GN5JmT8KOg5ctFaPreE5k0I/bhG5KG4fV9vx7/g2U3u5T+/MpnaQCY+0 iXq9IA8BJONwG/u1cCnp3D4b4r8kvibvX3eRoaEb6gVs+e+/1P8Q/pAdN805din5tvd9 4BQ4HGIAintHzbwKEms2+qI7tl8X/HVvUie5HG80SF9nR9jO46B8mb4jpx5yQtPpuq8z +wbQ== X-Received: by 10.180.107.136 with SMTP id hc8mr4897212wib.32.1417627184746; Wed, 03 Dec 2014 09:19:44 -0800 (PST) Received: from [192.168.0.64] (pas75-2-82-239-57-36.fbx.proxad.net. [82.239.57.36]) by mx.google.com with ESMTPSA id l10sm51559467wif.20.2014.12.03.09.19.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Dec 2014 09:19:43 -0800 (PST) Message-ID: <547F462E.8090001@gmail.com> Date: Wed, 03 Dec 2014 18:19:42 +0100 From: Flavio Henrique Araque Gurgel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org CC: osalm@mirakl.com Subject: ALTER TABLE documentation or parser bug Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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