Re: bug fix request - Mailing list pgsql-hackers

From Robert Treat
Subject Re: bug fix request
Date
Msg-id 200411292243.50841.xzilla@users.sourceforge.net
Whole thread Raw
In response to Re: bug fix request  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
On Monday 29 November 2004 02:58, Christopher Kings-Lynne wrote:
> > 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.)
>
> Hmmm...doesn't stop it being annoying, however.
>
> I presumed I was replicating the same problem I get when running SQL
> scripts that insert a few million rows.  Basically I start it running,
> then maybe some command before the COPY fails, then it gets to the COPY
> anyway and start barfing millions of lines.  Then I have to change my
> terminal settings to record heaps of lines and then try to ctrl-C the
> query before it scrolls too far off, just to find out the line that
> caused the error.
>

Chris, does the problem manifest itself if one of your COPY'd data lines 
violates a primary key with existing data in the table ?

-- 
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Error handling in plperl and pltcl
Next
From: Bruce Momjian
Date:
Subject: Re: multiline CSV fields