Sending errors from psql to error file

Devin Whalen devin-Gq53QDLGkWIleAitJ8REmdBPR1lH4CV8 at public.gmane.org
Thu Aug 12 14:24:06 UTC 2004


Hey,

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 to our new version.  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 and monitor every insert, 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 dataInserts.sql.gz | psql dbname -U username | grep "ERROR:*"
> import_errors

(obviously dbname and username have been change to protect the innocent
;))

Any help is appreciated.

Thanks.

-- 
Devin Whalen
Programmer
Synaptic Vision Inc
Phone-(416) 539-0801
Fax- (416) 539-8280
1179A King St. West
Toronto, Ontario
Suite 309 M6K 3C5
Home-(416) 653-3982
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list