Query that produces index information for a Table

From: "Boyd, Craig" <craig(at)mysoftforge(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Query that produces index information for a Table
Date: 2010-05-08 23:54:51
Message-ID: 4BE5F9CB.7080802@mysoftforge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello All,

I am trying to pull together some general information about indices
(indexes?) for a particular table.
I need the following: Index Name, Table Name, Column Name,
Unique/Non-Unique, and ordinal position in the index.
The information_schema.key_column_usage gets me most of the way there, I
think, but does not tell me whether the index is unique and does not
seem to differentiate between indices and other types of constraints.
I can't believe I am the first to ask this question so I am hoping
someone can send me what they use to get this information.

Thanks,

Craigbert

--
I am using the free version of SPAMfighter.
We are a community of 7 million users fighting spam.
SPAMfighter has removed 1387 of my spam emails to date.
Get the free SPAMfighter here: http://www.spamfighter.com/len

The Professional version does not have this message

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-05-09 01:03:41 Re: Query that produces index information for a Table
Previous Message Bruce Momjian 2010-05-08 23:04:43 Re: Documentation availability as a single page of text