[patch] ALTER RENAME and indexes

Поиск
Список
Период
Сортировка
От Brent Verner
Тема [patch] ALTER RENAME and indexes
Дата
Msg-id 20011006215833.A13452@rcfile.org
обсуждение исходный текст
Ответы Re: [patch] ALTER RENAME and indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [patch] ALTER RENAME and indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: anoncvs and CVS link off developers.postgresql.org
Следующее
От: Brent Verner
Дата:
Сообщение: Re: ALTER RENAME and indexes