deferring ForeignKey checks when you didn't set a deferrable constraint ?

Поиск
Список
Период
Сортировка
От Jonathan Vanasco
Тема deferring ForeignKey checks when you didn't set a deferrable constraint ?
Дата
Msg-id D2CD5A72-872B-4504-A75F-377819D0349A@2xlp.com
обсуждение исходный текст
Ответы Re: deferring ForeignKey checks when you didn't set a deferrable constraint ?  (Melvin Davidson <melvin6925@gmail.com>)
Список pgsql-general
I have a core table with tens-of-millions of rows, and need to delete about a million records.

There are 21 foreign key checks against this table.  Based on the current performance, it would take a few days to make
mydeletions. 

None of the constraints were defined as `DEFERRABLE INITIALLY IMMEDIATE', so I'm out of luck on deferring them.

Dropping/redefining constraints looks to be an ordeal --  and something I'm scared to make a mistake on.

i looked into disabling triggers on a table, but I couldn't find any info on how to trigger at the end of the
transactionso I can ensure integrity. 

does anyone have suggestions on things that might work?


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: better architecture?
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: deferring ForeignKey checks when you didn't set a deferrable constraint ?