Skip site navigation (1) Skip section navigation (2)

Possible bug in ALTER TABLE RENAME COLUMN (PostgreSQL 7.1.3)

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: "'pgsql-bugs(at)postgresql(dot)org'" <pgsql-bugs(at)postgresql(dot)org>
Subject: Possible bug in ALTER TABLE RENAME COLUMN (PostgreSQL 7.1.3)
Date: 2001-10-07 16:20:41
Message-ID: AA30E7BCCA5C1D4E88A231900F8325C00B7F@dogbert.vale-housing.co.uk (view raw or flat)
Thread:
Lists: pgsql-bugs
Hi,

During testing of new revision control code in pgAdmin II, I've found that
renaming an indexed column in a table does not automatically update the
index column name in pg_attribute. pg_get_indexdef does return the correct
definition however:

helpdesk=# CREATE TABLE sheep (cow text);
CREATE
helpdesk=# CREATE INDEX goat ON sheep (cow);
CREATE
helpdesk=# \d goat
   Index "goat"
 Attribute | Type
-----------+------
 cow       | text
btree

(END)
helpdesk=# ALTER TABLE sheep RENAME cow TO chicken;
ALTER
helpdesk=# \d sheep
        Table "sheep"
 Attribute | Type | Modifier
-----------+------+----------
 chicken   | text |
Index: goat

(END)
helpdesk=# \d goat
   Index "goat"
 Attribute | Type
-----------+------
 cow       | text
btree

(END)
helpdesk=# SELECT pg_get_indexdef((SELECT oid FROM pg_class WHERE relname =
'goat'));
                      pg_get_indexdef
-----------------------------------------------------------
 CREATE INDEX goat ON sheep USING btree (chicken text_ops)
(1 row)

(END)

(Please CC any replies as I'm not on this list)

Regards, Dave.

-- 
Dave Page (dpage(at)postgresql(dot)org)
http://pgadmin.postgresql.org/ 

Responses

pgsql-bugs by date

Next:From: BELLON MichelDate: 2001-10-08 11:49:07
Subject: Restoring table with array
Previous:From: Jason SpenceDate: 2001-10-06 22:22:52
Subject: [tim@perdue.net: Re: mysql2pgsql tool]

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group