X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 29589D1B9CA for ; Fri, 29 Aug 2003 02:38:40 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 70373-03 for ; Thu, 28 Aug 2003 23:38:33 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id F1A89D1B9B3 for ; Thu, 28 Aug 2003 23:38:28 -0300 (ADT) Received: (qmail 4955 invoked by uid 500); 29 Aug 2003 02:44:31 -0000 Date: Thu, 28 Aug 2003 21:44:31 -0500 From: Bruno Wolff III To: Mehrab Erfani Cc: pgsql-admin@postgresql.org Subject: Re: Hi, I have a question regarding the postgresql scripting Message-ID: <20030829024431.GC4373@wolff.to> Mail-Followup-To: Mehrab Erfani , pgsql-admin@postgresql.org References: <000a01c36db5$676227e0$0e01000a@MEHRAB> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000a01c36db5$676227e0$0e01000a@MEHRAB> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/347 X-Sequence-Number: 10067 On Thu, Aug 28, 2003 at 14:40:37 -0800, Mehrab Erfani wrote: > > I have written a script to import some data into my > database tables, with the delimiter ','. Now my question > is sometime the data being sent to my tables might not > match the data type or be corrupted and I receive an error message. > One: how could I prevent that? > Two: how can I divert all my error messages to a log file, where I can see > the errors later? > Three: how can I proceed with importing the rest of the data even though > some are corrupted? > Thanks Your script needs to check the data before passing it off to COPY or INSERT.