Re: COPY questions - Mailing list pgsql-general

From Jeff Davis
Subject Re: COPY questions
Date
Msg-id 1234986667.11205.7.camel@dell.linuxdev.us.dell.com
Whole thread Raw
In response to COPY questions  (Bill Todd <pg@dbginc.com>)
List 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


pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Debugging custom type libraries
Next
From: "Brent Wood"
Date:
Subject: Re: Appending \o output instead of overwriting the output file