| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера