Re: postgres 8.2 "end-of-copy marker corrupt" - Mailing list pgsql-novice

From David Monarchi
Subject Re: postgres 8.2 "end-of-copy marker corrupt"
Date
Msg-id eea51fdb0703272230rbae1b27g4a8023f6c3ee97fe@mail.gmail.com
Whole thread Raw
In response to Re: postgres 8.2 "end-of-copy marker corrupt"  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: postgres 8.2 "end-of-copy marker corrupt"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Thanks for the suggestions, Tom.  The file is about 3G from a FreeBSD box, but I'm doing some work on it on an XP box.  I have a number of other files that I created in exactly the same way from a PG 8.2 db on the BSD box.  They all load fine. 

Each line is terminated with a LF (0A), including the last line.  This is the structure that of all of the other files that I can load have.

Some of the text fields in the file had \ in them, so I simply replaced all of them with blanks to see if somewhere there was an escape sequence that was causing the problem.

At this point, based on what you said, the only thing I can think of is an errant quote. 

I'm tempted to remove all single and double quotation marks, but that will cause some other problems.  Can you think of anything to do other than write a program to load the data one record at a time to see where it breaks?  (There are 20M records in the file.  )

Thanks again,
David

On 3/26/07, Tom Lane < tgl@sss.pgh.pa.us> wrote:
"David Monarchi" <david.e.monarchi@gmail.com> writes:
> I'm trying to copy a file to a table in Postgres 8.2 and keep receiving the
> following message

>   ERROR: end-of-copy marker corrupt
>   CONTEXT:  COPY domain_dom, line 3147756: ""

Have you looked at the input file near that line number?  My guess is
misquoting of a \. sequence, or possibly (since you seem to be on
Windows) a LF-vs-CR/LF end-of-line format issue.  It need not be
close to the actual end of that file...

                        regards, tom lane

pgsql-novice by date:

Previous
From: "Shoaib Mir"
Date:
Subject: Re: VB6 and postgresql
Next
From: Tom Lane
Date:
Subject: Re: postgres 8.2 "end-of-copy marker corrupt"