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

Поиск
Список
Период
Сортировка
От Jonathan Vanasco
Тема Re: deferring ForeignKey checks when you didn't set a deferrable constraint ?
Дата
Msg-id B5B9D805-BC67-4F83-8C36-DF48684684BC@2xlp.com
обсуждение исходный текст
Ответ на Re: deferring ForeignKey checks when you didn't set a deferrable constraint ?  (Melvin Davidson <melvin6925@gmail.com>)
Список pgsql-general
On Nov 20, 2014, at 6:00 PM, Melvin Davidson wrote:

> Try the following queries. It will give you two .sql files (create_fkeys.sql & drop_fkeys.sql).

Thanks!

I tried a variation of that to create DEFERRABLE constraints, and that was a mess.  It appears all the checks ran at
theend of the transaction individually – the process consumed 100% cpu overnight and was stuck on the 'commit' after 16
hours..

So I crossed my fingers and tried your code like this:

    BEGIN;
    DROP CONSTRAINT ..... x24;
    DELETE;
    ADD CONSTRAINT ..... x24;
    COMMIT;

And that took just over 24 seconds.



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: pgsql_tmp consuming all inodes
Следующее
От: "Nestor A. Diaz"
Дата:
Сообщение: Re: pgsql_tmp consuming all inodes