Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkdKQ-0003ED-95 for pgsql-bugs@arkaria.postgresql.org; Wed, 14 May 2014 17:50:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WkdKP-0002Ti-Mz for pgsql-bugs@arkaria.postgresql.org; Wed, 14 May 2014 17:50:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkYVZ-0007hQ-86 for pgsql-bugs@postgresql.org; Wed, 14 May 2014 12:42:05 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkYVW-0005wu-W7 for pgsql-bugs@postgresql.org; Wed, 14 May 2014 12:42:04 +0000 MIME-Version: 1.0 Subject: BUG #10316: Alter table rename fails if the "new name" starts with '_' To: pgsql-bugs@postgresql.org From: parthibanp2@gmail.com Date: Wed, 14 May 2014 12:41:19 +0000 Message-ID: <20140514124119.11846.62730@wrigleys.postgresql.org> X-Pg-Spam-Score: -0.1 (/) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 The following bug has been logged on the website: Bug reference: 10316 Logged by: Parthi Email address: parthibanp2@gmail.com PostgreSQL version: 9.3.2 Operating system: Mac OSX 10.9.2 Description: Hi I'm facing one peculiar behaviour(bug?) with Alter table rename query SQL. -- I have created one new table with name t1 test=# \d No relations found. test=# create table t1 (name varchar(10)); CREATE TABLE -- After that i tried to rename 't1' table as '_t1', now the Postgres server saying '_t1' is already exists. i'm sure there is no other table in the database other than 't1'. test=# alter table t1 rename to _t1; ERROR: type "_t1" already exists -- Now i renaming table from 't1' to '__t1' and again i renaming from '__t1' to '_t1' now its working. test=# alter table t1 rename to __t1; ALTER TABLE test=# alter table __t1 rename to _t1; ALTER TABLE -- Again i renamed '_t1' to 't1', once again i tried the first query , now its working. test=# alter table _t1 rename to t1; ALTER TABLE test=# alter table t1 rename to _t1; ALTER TABLE May i know , why the rename query failed initially? if it is bug then how the same query succeeded during second time? -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs