| От | John R Pierce |
|---|---|
| Тема | Re: temporarily disabling foreign keys |
| Дата | |
| Msg-id | 4DC9853D.90607@hogranch.com обсуждение исходный текст |
| Ответ на | temporarily disabling foreign keys (Seb <spluque@gmail.com>) |
| Список | pgsql-general |
On 05/10/11 11:12 AM, Seb wrote: > Hi, > > I'm not sure how best to handle this situation. The tables in a > database need to be completely cleared and copy'ed into about every few > months, as they are updated with new records and corrections from a > provider. Because the tables have foreign key constraints with 'ON > UPDATE CASCADE ON DELETE RESTRICT', it's not possible to DELETE them > without violating these constraints. I've been dropping the constraints > while doing these transactions and then recreating them once everything > is done, but this has gotten tedious. Is there some way to "disable" > the foreign keys and enabling them after the transactions? Thanks. might be faster to just drop the tables and recreate them.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера