Skip site navigation (1) Skip section navigation (2)

Timely reporting of COPY errors

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Postgresql <pgsql-hackers(at)postgresql(dot)org>
Subject: Timely reporting of COPY errors
Date: 2008-04-16 20:29:07
Message-ID: 20080416202907.GA26340@svana.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

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? Looking at the code we have this comment in putCopyData:

  /*
   * Process any NOTICE or NOTIFY messages that might be pending in the
   * input buffer.  Since the server might generate many notices during the
   * COPY, we want to clean those out reasonably promptly to prevent
   * indefinite expansion of the input buffer.  (Note: the actual read of
   * input data into the input buffer happens down inside pqSendSome, but
   * it's not authorized to get rid of the data again.)
   */

Except that pqSendSome won't try reading anything until it has a
problem writing. Since the backend will consume copy data indefinitly,
the error message sits in the kernel buffers until the end.

Is there anything that can be done? I've tried putting in
PQconsumeInput in places but it doesn't appear to help.

Any ideas?
-- 
Martijn van Oosterhout   <kleptog(at)svana(dot)org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while 
> boarding. Thank you for flying nlogn airlines.

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2008-04-16 20:36:13
Subject: Re: How to submit a patch
Previous:From: Joshua D. DrakeDate: 2008-04-16 20:21:10
Subject: Re: How to submit a patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group