Re: COPY questions

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Bill Todd <pg(at)dbginc(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: COPY questions
Date: 2009-02-18 19:51:07
Message-ID: 1234986667.11205.7.camel@dell.linuxdev.us.dell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2009-02-18 at 11:56 -0700, Bill Todd wrote:
> If the COPY command fails does it identify the offending row?

Yes, it tries to identify the failing row in the error message.

> After reading the manual and the wiki I assume that there is no way to
> tell copy to start with the Nth record in the input file. Is that
> correct? It seems like such an obvious feature I was surprised not to
> find it. Thanks.

That's correct.

There are a lot of features that people could find useful: various
formats and various manipulations of the data before it's processed. If
all of those features were implemented, COPY would start to look more
like perl.

In general, it's best to preprocess the data yourself and pipe the
result to a "COPY ... FROM STDIN" command. That way you can actually use
perl if you want to.

Regards,
Jeff Davis

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brent Wood 2009-02-18 20:12:39 Re: Appending \o output instead of overwriting the output file
Previous Message Martijn van Oosterhout 2009-02-18 19:31:52 Re: Debugging custom type libraries