Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 1AA69634E37 for ; Tue, 28 Jul 2009 17:09:09 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 31878-04-2 for ; Tue, 28 Jul 2009 20:08:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) by mail.postgresql.org (Postfix) with ESMTP id 8BB2E634CAF for ; Tue, 28 Jul 2009 17:08:58 -0300 (ADT) Received: from in02.mta.xmission.com ([166.70.13.52]) by out02.mta.xmission.com with esmtp (Exim 4.62) (envelope-from ) id 1MVsyn-0000Qg-1Q; Tue, 28 Jul 2009 14:08:57 -0600 Received: from [208.187.158.94] (helo=[172.16.1.228]) by in02.mta.xmission.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MVsym-00012f-Kr; Tue, 28 Jul 2009 14:08:56 -0600 Message-ID: <4A6F5AD3.1000700@gmail.com> Date: Tue, 28 Jul 2009 14:08:51 -0600 From: Rob Sargent User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Akos Gabriel CC: pgsql-sql@postgresql.org References: <20090728201240.1daff5bb@gabriel-desktop> In-Reply-To: <20090728201240.1daff5bb@gabriel-desktop> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-XM-SPF: eid=; ; ; mid=; ; ; hst=in02.mta.xmission.com; ; ; ip=208.187.158.94; ; ; frm=robjsargent@gmail.com; ; ; spf=neutral X-SA-Exim-Connect-IP: 208.187.158.94 X-SA-Exim-Rcpt-To: akos.gabriel@i-logic.hu, pgsql-sql@postgresql.org, robjsargent@gmail.com X-SA-Exim-Mail-From: robjsargent@gmail.com X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Akos Gabriel X-Spam-Relay-Country: Subject: Re: Detect referential integrity structure X-SA-Exim-Version: 4.2.1 (built Thu, 25 Oct 2007 00:26:12 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=-10 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/136 X-Sequence-Number: 32877 Perhaps another option: Alter the references to ON DELETE CASCADE as seen here Akos Gabriel wrote: > Hi, > > I've a big/complex database (Adempiere - www.adempiere.org ) where I'd > like to delete some rows from some tables (delete a client and its > data from the ERP database). > All tables are in one schema (adempiere). > There are some foreign keys/constraints. > I've following options: > > - disable all constraints, doing the delete, enable all constraints. > - find out the "right sequence" and do the delete -s. > > Does anyone have such an algorythm, or a method of disabling all the > constraints? We have 8.3.7 right now. The solution will be published > into the Adempiere wiki / contributed to the project as well. > > Thanks in advance, > Akos Gabriel > >