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

From Tom Lane
Subject Re: [patch] ALTER RENAME and indexes
Date
Msg-id 20384.1002466569@sss.pgh.pa.us
Whole thread Raw
In response to [patch] ALTER RENAME and indexes  (Brent Verner <brent@rcfile.org>)
Responses Re: [patch] ALTER RENAME and indexes
List 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 by date:

Previous
From: Brent Verner
Date:
Subject: Re: ALTER RENAME and indexes
Next
From: "Serguei Mokhov"
Date:
Subject: Re: UTF-8 support