Re: Extracting Index Creation Script - Mailing list pgsql-general

From Vyacheslav Kalinin
Subject Re: Extracting Index Creation Script
Date
Msg-id 9b1af80e0710232152g7e91dccdqc65c5f4830bea642@mail.gmail.com
Whole thread Raw
In response to Extracting Index Creation Script  (Paul Silveira <plabrh1@gmail.com>)
List pgsql-general


If you know the index name then:
SELECT pg_get_indexdef('your_index_name'::regclass)
will do.

In case you want a full list of indices for a certain table:
SELECT c2.relname, pg_get_indexdef(i.indexrelid, 0, true), c2.reltablespace
  FROM pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_index i
 WHERE c.oid = 'your_table_name'::regclass AND c.oid = i.indrelid AND i.indexrelid = c2.oid

If you have more questions of that kind try starting psql with -E option which enables internal queries' display (this is what I did).

pgsql-general by date:

Previous
From: "Vyacheslav Kalinin"
Date:
Subject: Re: (Never?) Kill Postmaster?
Next
From: Pingale.amol@gmail.com
Date:
Subject: postgres bash prompt error while user creation