pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: parthibanp2@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #10316: Alter table rename fails if the "new name" starts with '_'
Date: Wed, 14 May 2014 12:41:19 +0000
Message-ID: <20140514124119.11846.62730@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (2+ messages)  latest in thread

Message-ID: <20140514124119.11846.62730@wrigleys.postgresql.org>
Permalink:  ../20140514124119.11846.62730@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20140514124119.11846.62730@wrigleys.postgresql.org

 · 

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: parthibanp2@gmail.com
  Subject: Re: BUG #10316: Alter table rename fails if the "new name" starts with '_'
  In-Reply-To: <20140514124119.11846.62730@wrigleys.postgresql.org>
  References: <20140514124119.11846.62730@wrigleys.postgresql.org>

* 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