Re: FK Constraint on index not PK

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: FK Constraint on index not PK
Дата
Msg-id 24951.1168705867@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: FK Constraint on index not PK  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
Alvaro Herrera <alvherre@commandprompt.com> writes:
> The problem is that the constraint was defined with a dependence on the
> second index.  I guess what you could do is drop the constraint, drop
> the second index, and then recreate the constraint.  Try it within a
> transaction block, just in case it doesn't work (but I don't see why it
> wouldn't)

That's certainly the safest way, but if this is a live production
database then the time spent holding exclusive locks while
re-establishing the FK constraint may be a problem.  If that's not
tolerable then the solution is manually mucking with the system
catalogs as I suggested in an earlier reply.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problems with unique restrictions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: index type for indexing long texts