[patch] ALTER RENAME and indexes - Mailing list pgsql-hackers

From Brent Verner
Subject [patch] ALTER RENAME and indexes
Date
Msg-id 20011006215833.A13452@rcfile.org
Whole thread Raw
Responses Re: [patch] ALTER RENAME and indexes
Re: [patch] ALTER RENAME and indexes
List pgsql-hackers
The attached patch works for my case...

regression=# create table test (id serial, col1 varchar(64));
NOTICE:  CREATE TABLE will create implicit sequence 'test_id_seq' for SERIAL column 'test.id'
NOTICE:  CREATE TABLE/UNIQUE will create implicit index 'test_id_key' for table 'test'
CREATE
regression=# create index i_t_c on test(col1);
CREATE
regression=# alter table test rename col1 to col2;
ALTER
regression=# \d test                                  Table "test"Column |         Type          |
Modifiers                   
 
--------+-----------------------+-------------------------------------------------id     | integer               | not
nulldefault nextval('"test_id_seq"'::text)col2   | character varying(64) | 
 
Indexes: i_t_c
Unique keys: test_id_key

regression=# \d itc
Did not find any relation named "itc".
regression=# \d i_t_c        Index "i_t_c"Column |         Type          
--------+-----------------------col2   | character varying(64)
btree


wooohoo!!!  Of course, it would be best if someone else looked this
code over, because I get the feeling there is an easier way to get
this done.  The only thing I can say is that it solves my problem
and does not /appear/ to create any others.

cheers. Brent

p.s., I appreciate the gurus not jumping in with the quick fix --
The experience has been fun :-)

-- 
"Develop your talent, man, and leave the world something. Records are 
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing."  -- Duane Allman

pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: anoncvs and CVS link off developers.postgresql.org
Next
From: Brent Verner
Date:
Subject: Re: ALTER RENAME and indexes