X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 09EF214B280B for ; Thu, 12 Aug 2004 11:50:43 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31430-04 for ; Thu, 12 Aug 2004 14:50:34 +0000 (GMT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id 93BB914B27FC for ; Thu, 12 Aug 2004 11:50:32 -0300 (ADT) Received: from mailgate.bray-healthcare.com ([80.177.250.202] helo=solport.bray-healthcare.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.35 #1) id 1BvGuY-000Hm2-0Z; Thu, 12 Aug 2004 14:50:34 +0000 Received: from braydb.bray-healthcare.com ([192.168.1.18]) by solport.bray-healthcare.com with esmtp (Exim 3.36 #1 (Debian)) id 1BvGuY-0007fw-00; Thu, 12 Aug 2004 15:50:34 +0100 Subject: Re: Sending errors from psql to error file From: Oliver Elphick Reply-To: olly@lfix.co.uk To: devin@synapticvision.com Cc: pgsql-sql@postgresql.org In-Reply-To: <1092320416.23985.24.camel@192.168.1.80> References: <1092320416.23985.24.camel@192.168.1.80> Content-Type: text/plain Message-Id: <1092322233.11188.30.camel@braydb> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Thu, 12 Aug 2004 15:50:34 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/114 X-Sequence-Number: 18611 On Thu, 2004-08-12 at 15:20, Devin Whalen wrote: > Hello, > > I am trying to migrate a client from one database to another. Basically > we designed a web application for them using Postgresql but we have made > many changes to the design of our application since version 1. Now they > want to upgrade. So basically I have to pg_dump their current data and > then import it into our new schema. Now, of course I realize that there > are going to be errors. But they have a lot and I mean a lot of data. > I don't want to have to sit there and watch the import go by, I want to > run a command and then look in a file for any errors after the import is > complete. I tried this command but it didn't work: > gunzip -c cli_postDataInserts.sql.gz | psql cli_post -U system | grep > "ERROR:*" > import_errors > > Any help is appreciated. 1. "didn't work" is not much help 2. Use the --echo-queries and -f options to psql and capture all the output; a bare error line won't tell you much about what happened nor where it happened - you need to see what query was running. The -f will let psql report which line in the input. zcat cli_postDataInserts.sql.gz | psql -d cli_post -U system --echo-queries -f - >trace.file 2>&1 Oliver Elphick