Skip site navigation (1) Skip section navigation (2)

psql copy errors

From: David Bear <David(dot)Bear(at)asu(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: psql copy errors
Date: 2005-06-23 19:27:44
Message-ID: 20050623192744.GC398@asu.edu (view raw or flat)
Thread:
Lists: pgsql-admin
I'm finding the \copy is very brittle. It seems to stop for everyone
little reason. Is there a way to tell it to be more forgiving -- for
example, to ignore extra data fields that might exists on a line?

Or, to have it just skip that offending record but continue on to the
next.

I've got a tab delimited file, but if \copy sees any extra tabs in the
file it just stops at that record. I want to be able to control what
pg does when it hits an exception.

I'm curious what others do for bulk data migration. Since copy seems
so brittle, there must be a better way...

-- 
David Bear
phone: 	480-965-8257
fax: 	480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
 "Beware the IP portfolio, everyone will be suspect of trespassing"

Responses

pgsql-admin by date

Next:From: Michael FuhrDate: 2005-06-23 20:17:16
Subject: Re: psql copy errors
Previous:From: Tom LaneDate: 2005-06-23 18:59:20
Subject: Re: restoring wal archive and pg_xlog dir

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group