Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A023564FCFE for ; Wed, 13 Aug 2008 03:33:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 79534-05 for ; Wed, 13 Aug 2008 03:33:08 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by postgresql.org (Postfix) with ESMTP id F021664FCE3 for ; Wed, 13 Aug 2008 03:33:07 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.1/8.14.1) with ESMTP id m7D6X5RJ081878 for ; Wed, 13 Aug 2008 03:33:05 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.1/8.14.1/Submit) id m7D67euu058132 for pgsql-performance@postgresql.org; Wed, 13 Aug 2008 03:07:40 -0300 (ADT) (envelope-from news) From: "Sabin Coanda" X-Newsgroups: pgsql.performance Subject: Re: long transaction Date: Wed, 13 Aug 2008 09:07:49 +0300 Organization: Hub.Org Networking Services Lines: 15 Message-ID: References: <120621.32315.qm@web59503.mail.ac4.yahoo.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Original To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200808/146 X-Sequence-Number: 31027 > > have you considered importing to a temporary 'holding' table with > copy, then doing 'big' sql statements on it to check constraints, etc? > Yes I considered it, but the problem is the data is very tight related between different tables and is important to keep the import order of each entity into the database. With other words, the entity imprt serialization is mandatory. In fact the import script doesn't keep just insert but also delete and update for different entities. So copy is not enough. Also using 'big' sql statements cannot guarantee the import order. Sabin