Re: [patch] ALTER RENAME and indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [patch] ALTER RENAME and indexes
Дата
Msg-id 20384.1002466569@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [patch] ALTER RENAME and indexes  (Brent Verner <brent@rcfile.org>)
Ответы Re: [patch] ALTER RENAME and indexes  (Brent Verner <brent@rcfile.org>)
Список pgsql-hackers
It occurs to me that the real problem is not so much ALTER RENAME not
doing enough, as it is psql doing the wrong thing.  The \d display for
indexes is almost entirely unhelpful, since it doesn't tell you such
critical stuff as whether the index is a functional index nor which
index opclasses are being used.  I wonder whether we oughtn't rip out
the whole display and make it report the results of pg_get_indexdef(),
instead.

regression=# create table foo(f1 int,f2 int, primary key(f1,f2));
NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index 'foo_pkey' for table 'foo'
CREATE
regression=# \d foo        Table "foo"Column |  Type   | Modifiers
--------+---------+-----------f1     | integer | not nullf2     | integer | not null
Primary key: foo_pkey

regression=# create index foofn on foo (int4pl(f1,f2));
CREATE
regression=# \d foofn Index "foofn"Column |  Type
--------+---------int4pl | integer
btree

regression=# select pg_get_indexdef(oid) from pg_class where relname = 'foofn';                   pg_get_indexdef
--------------------------------------------------------CREATE INDEX foofn ON foo USING btree (int4pl(f1, f2))
(1 row)

regression=# alter table foo rename f1 to f1new;
ALTER
regression=# select pg_get_indexdef(oid) from pg_class where relname = 'foofn';                     pg_get_indexdef
-----------------------------------------------------------CREATE INDEX foofn ON foo USING btree (int4pl(f1new, f2))
(1 row)

        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Brent Verner
Дата:
Сообщение: Re: ALTER RENAME and indexes
Следующее
От: "Serguei Mokhov"
Дата:
Сообщение: Re: UTF-8 support