Re: how to disable all pkey/fkey constraints globally

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: how to disable all pkey/fkey constraints globally
Date: 2011-10-04 18:15:21
Message-ID: 4E8B4D39.8030802@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/04/11 10:59 AM, J.V. wrote:
> Maybe I do not want to drop, so is there a way to simply disable all
> globally (not drop) & then enable all globally?

IF there was such a method (I don't think there is), to reenable the
constraints would require going through every single row of every single
table and verify the constraints are valid prior to enabling them.
this would require global locks on each table so they didn't get updated
between the time said validation starts and when the constraint is
actually enabled to prevent any possibility of inconsistency from
creeping in.

*OUCH*

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Browse pgsql-general by date

  From Date Subject
Next Message J.V. 2011-10-04 18:21:35 fail: alter table <table_name> NOCHECK CONSTRAINT ALL;
Previous Message Rohit Coder 2011-10-04 18:10:43 Re: Why PGSQL has no developments in the .NET area?