Re: temporarily disabling foreign keys

From: Vick Khera <vivek(at)khera(dot)org>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: temporarily disabling foreign keys
Date: 2011-05-10 18:29:48
Message-ID: BANLkTimnBBp1Vm+d0P9seMiY9TXQJOXtDw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

in recent versions of postgres, there is a "replication" mode designed
specifically for replication software to disable FK's and other
triggers. Perhaps investigate that.

the other option is to make your FK's deferrable, and do all your
delete in one big transaction with the FK checks deferred. not sure
if that will help.

either that, or order your deletes and loads in a way such that the
FKs remain satisfied. unless you have circular dependencies, this
should be possible.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2011-05-10 18:34:37 Re: temporarily disabling foreign keys
Previous Message Seb 2011-05-10 18:12:14 temporarily disabling foreign keys