Re: Selecting names of indexes that are not dependent on constraints.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Selecting names of indexes that are not dependent on constraints.
Дата
Msg-id 20643.1268321687@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Selecting names of indexes that are not dependent on constraints.  (Dmitriy Igrishin <dmitigr@gmail.com>)
Список pgsql-sql
Dmitriy Igrishin <dmitigr@gmail.com> writes:
> How can I select names of indexes of table (or even whole schema) that are
> not dependent on constraints?

Right at the moment, the only reliable way to tell whether an index is
associated with a constraint is to look for a pg_depend entry linking
the two.  Be careful to consider only "internal" dependencies, else you
may be fooled by foreign-key constraints that depend on indexes.
If you look into the pg_dump source code you will find an example.

9.0 will make this a tad simpler by keeping a "conindid" column in
pg_constraint.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Dmitriy Igrishin
Дата:
Сообщение: Re: Selecting names of indexes that are not dependent on constraints.
Следующее
От: "Ray Madigan"
Дата:
Сообщение: Trigger on select :-(