Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 the end 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.



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux