Re: Query to retrieve all indexed columns - Mailing list pgsql-sql

From Tom Lane
Subject Re: Query to retrieve all indexed columns
Date
Msg-id 8307.1227119066@sss.pgh.pa.us
Whole thread Raw
In response to Query to retrieve all indexed columns  ("Bart van Houdt" <bart.van.houdt@syfact.com>)
List pgsql-sql
"Bart van Houdt" <bart.van.houdt@syfact.com> writes:
> I am working on a query to retrieve all indexed columns and came up with
> the following query:
> ...
> Tis query works for single column indexes, but with multiple column
> indexes I get incorrect results... I'm having a hard time figuring out
> how to join pg_attribute.indkey in this, could anyone help me out on
> this one?  

Look at the information_schema views.  You might find that one of them
already solves your problem ... and even if not, they will provide
examples of how to deconstruct the catalog information.
share/information_schema.sql in an installed PG file set is the
most convenient thing to study.
        regards, tom lane


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: VACUUM cannot be executed from multi-command string
Next
From: novice
Date:
Subject: date range query help