Re: disabling constraints

From: "David Parker" <dparker(at)tazznetworks(dot)com>
To: "Vivek Khera" <khera(at)kcilink(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: disabling constraints
Date: 2004-11-04 20:38:58
Message-ID: 07FDEE0ED7455A48AC42AC2070EDFF7C1497E8@corpsrv2.tazznetworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi. Thanks for responding.

I don't *think* there are circular references, but the nature of the
problem is that the code doesn't know anything about the semantics of
the schema - it just gets the list of tables, and there are multiple
schemas it needs to handle, all of which may change over time. That's
why I was hoping for some kind of global "disable constraints" command.

I guess it should be possible to generate the proper table order based
on loading up all of the constraints from the catalog. It seems like
more trouble than I want to go to for this problem, but maybe it
wouldn't be too difficult...

- DAP

>-----Original Message-----
>From: pgsql-general-owner(at)postgresql(dot)org
>[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Vivek Khera
>Sent: Thursday, November 04, 2004 3:05 PM
>To: pgsql-general(at)postgresql(dot)org
>Subject: Re: [GENERAL] disabling constraints
>
>>>>>> "DP" == David Parker <dparker(at)tazznetworks(dot)com> writes:
>
>DP> I would like to be able to truncate all of the tables in a schema
>DP> without worrying about FK constraints. I tried issuing a "SET
>DP> CONSTRAINTS ALL DEFERRED" before truncating, but I still get
>DP> constraint errors. Is there a way to do something like:
>
>Why don't you truncate your tables in an order that won't
>violate FK's? Or do you have circular references?
>
>--
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>Vivek Khera, Ph.D. Khera Communications, Inc.
>Internet: khera(at)kciLink(dot)com Rockville, MD +1-301-869-4449 x806
>AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
>
>---------------------------(end of
>broadcast)---------------------------
>TIP 8: explain analyze is your friend
>

Browse pgsql-general by date

  From Date Subject
Next Message Steinar H. Gunderson 2004-11-04 20:46:03 Re: Restricting Postgres
Previous Message Tom Lane 2004-11-04 20:36:32 Re: disabling constraints