Michael Fuhr <mike@fuhr.org> writes:
> On Fri, Mar 03, 2006 at 05:46:59PM +1100, Chris wrote:
>> If I look at an index:
>> It doesn't show me which fields it actually applies to, only the table.
> \d news_pkey
Also, \d on the index's parent table will show you all the index
definitions. This is more useful than the "\d index" display in some
cases, particularly non-default opclasses and index expressions.
For example:
regression=# create index fooi on tenk1((unique1+unique2));
CREATE INDEX
regression=# \d fooi
Index "public.fooi"
Column | Type
-----------------+---------
pg_expression_1 | integer
btree, for table "public.tenk1"
regression=# \d tenk1
...
Indexes:
"fooi" btree ((unique1 + unique2))
...
I'm not really sure why we don't account for these cases in "\d index",
unless that it's hard to see where to fit the info into a tabular
layout.
regards, tom lane