Re: Extracting Index Creation Script

Поиск
Список
Период
Сортировка
От Vyacheslav Kalinin
Тема Re: Extracting Index Creation Script
Дата
Msg-id 9b1af80e0710232152g7e91dccdqc65c5f4830bea642@mail.gmail.com
обсуждение исходный текст
Ответ на Extracting Index Creation Script  (Paul Silveira <plabrh1@gmail.com>)
Список 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 по дате отправления: