Re: extended index info

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Chris <dmagick(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: extended index info
Date: 2006-03-03 14:33:49
Message-ID: 217.1141396429@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Fuhr <mike(at)fuhr(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-03-03 14:41:50 Re: Postgres automatically inserts chr(13) whenever chr(10) is inserted
Previous Message Douglas McNaught 2006-03-03 14:31:41 Re: Linux cluster application