pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: devin@synapticvision.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Sending errors from psql to error file
Date: Thu, 12 Aug 2004 15:50:34 +0100
Message-ID: <1092322233.11188.30.camel@braydb> (raw)
In-Reply-To: <1092320416.23985.24.camel@192.168.1.80>
References: <1092320416.23985.24.camel@192.168.1.80>

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





view thread (7+ messages)  latest in thread

Message-ID: <1092322233.11188.30.camel@braydb>
Permalink:  ../1092322233.11188.30.camel@braydb/
Also on:    postgresql.org/message-id/1092322233.11188.30.camel@braydb

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: olly@lfix.co.uk, devin@synapticvision.com
  Subject: Re: Sending errors from psql to error file
  In-Reply-To: <1092322233.11188.30.camel@braydb>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox