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 ([EMAIL PROTECTED])
http://pgadmin.postgresql.org/ 

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to