Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 231BA6358E7 for ; Tue, 28 Jul 2009 15:28:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 23825-06-5 for ; Tue, 28 Jul 2009 18:28:31 +0000 (UTC) X-Greylist: delayed 00:07:21.999778 by SQLgrey-1.7.6 Received: from smarty.gabriel.co.hu (smarty.gabriel.co.hu [195.70.37.16]) by mail.postgresql.org (Postfix) with ESMTP id 62F9863606B for ; Tue, 28 Jul 2009 15:20:06 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by smarty.gabriel.co.hu (Postfix) with ESMTP id 711C349322 for ; Tue, 28 Jul 2009 20:12:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at Received: from smarty.gabriel.co.hu ([127.0.0.1]) by localhost (smarty.i-logic.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ryP8+1LFof+m for ; Tue, 28 Jul 2009 20:12:41 +0200 (CEST) Received: from gabriel-desktop (catv-80-98-227-193.catv.broadband.hu [80.98.227.193]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smarty.gabriel.co.hu (Postfix) with ESMTPSA id 435834928E for ; Tue, 28 Jul 2009 20:12:41 +0200 (CEST) Date: Tue, 28 Jul 2009 20:12:40 +0200 From: Akos Gabriel To: pgsql-sql@postgresql.org Subject: Detect referential integrity structure Message-ID: <20090728201240.1daff5bb@gabriel-desktop> Organization: I-Logic Ltd X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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/135 X-Sequence-Number: 32876 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 --=20 =C3=9Cdv=C3=B6zlettel, G=C3=A1briel =C3=81kos -=3DE-Mail :akos.gabriel@i-logic.hu|Web: http://www.i-logic.hu=3D- -=3DTel/fax:+3612391618 |Mobil:+36209278894 =3D-