Re: Timely reporting of COPY errors - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Timely reporting of COPY errors
Date
Msg-id 23259.1208380937@sss.pgh.pa.us
Whole thread Raw
In response to Timely reporting of COPY errors  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Timely reporting of COPY errors  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: Timely reporting of COPY errors  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> I notice that while doing bulk-loads that any errors detected by the
> backend arn't noticed by libpq until right at the end. Is this
> intentional?

I dunno about "intentional", but the API exposed by libpq for COPY
doesn't really permit any other behavior: you push all the data and
then look to see if it worked or not.

Even if we had some way of letting the application notice that the copy
had already failed, I don't see that psql could do very much with it,
at least not for COPY FROM STDIN.  It's got to read through the source
data anyway or it'll be out of sync with the script file.

We could possibly fix libpq to start dropping the data on the floor
if it sees an error reply already pending, but that's only going
to be an incremental change.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Brendan Jurd"
Date:
Subject: Re: [PATCHES] Text <-> C string
Next
From: Bruce Momjian
Date:
Subject: Re: Lessons from commit fest