Re: How to know the indexes on a Table - Mailing list pgsql-general

From Tom Lane
Subject Re: How to know the indexes on a Table
Date
Msg-id 4562.1244215079@sss.pgh.pa.us
Whole thread Raw
In response to How to know the indexes on a Table  ("Anirban Pal" <anirban.pal@newgen.co.in>)
List pgsql-general
"Anirban Pal" <anirban.pal@newgen.co.in> writes:
> Is there any way, to know the name of indexes on a table, defined in a database. I mean can I query something like
> Select Index_name from pg_class where relname = "Table_name" . Thanks in advance.

You need to join through pg_index, specifically its columns indrelid and
indexrelid.  Try running psql with the -E option and look at the queries
it uses to implement "\d Table_name".

            regards, tom lane

pgsql-general by date:

Previous
From: Vick Khera
Date:
Subject: Re: invalid byte sequence for encoding "UTF8": 0xab
Next
From: Brandon Metcalf
Date:
Subject: Re: limit table to one row