Re: PQputCopyData dont signal error - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PQputCopyData dont signal error
Date
Msg-id 31845.1396125518@sss.pgh.pa.us
Whole thread Raw
In response to Re: PQputCopyData dont signal error  (steve k <steven.c.kohler@nasa.gov>)
List pgsql-hackers
steve k <steven.c.kohler@nasa.gov> writes:
> I realize this is an old thread, but seems to be the only discussion I can
> find on this topic "I have a problem with PQputCopyData function. It doesn't
> signal some error. "  

PQputCopyData/PQputCopyEnd are only concerned with transferring data.
After you're done with that, you should call PQgetResult to find out the
COPY command's completion status.  You should get PGRES_COMMAND_OK,
otherwise it'll be an error result.

> Does anyone have any ideas or know if this is being worked on?  Am I
> completely missing something obvious here?

Um ... you could have read the manual:
http://www.postgresql.org/docs/9.3/static/libpq-copy.html
Or looked at the source code for psql, which as you noted has no problem
displaying errors for COPY.
        regards, tom lane



pgsql-hackers by date:

Previous
From: steve k
Date:
Subject: Re: PQputCopyData dont signal error
Next
From: Bruce Momjian
Date:
Subject: Re: psql \d+ and oid display