Re: bug fix request - Mailing list pgsql-hackers

From Tom Lane
Subject Re: bug fix request
Date
Msg-id 9939.1101714577@sss.pgh.pa.us
Whole thread Raw
In response to Re: bug fix request  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Responses Re: bug fix request  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> Presently you get a million lines of '\N command not recognised' and 
> various other random things because if a line of the copy fails due to 
> say a FK constraint, or even if the COPY is run in an aborted 
> transaction, it tries to execute all the stdin data as actual 
> statements.
>> 
>> I'd like to see a test case for this in v3 protocol.  It was definitely
>> a problem before that, but I thought I fixed it.

> This is with 7.4 and it still does it....  Here is an example:

Hmm.  This error is not coming from "a line of the copy", it is occurring
because the COPY command itself fails, and so the server never tells
psql to shift into COPY mode.  I'm not sure that a reasonable fix for
this is possible.  As a counterexample, if you misspelled COPY as COPZ,
would you expect the software to decide that following lines up to
\. should be ignored?  If you manually misentered a COPY command and got
an error, would you be surprised to have psql ignore everything you
typed until you typed \. ?  (I can bet we'd get bug reports about that.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Adding Reply-To: to Lists configuration ...
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: bug fix request