Re: PQputCopyData dont signal error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: steve k <steven(dot)c(dot)kohler(at)nasa(dot)gov>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PQputCopyData dont signal error
Date: 2014-03-29 20:38:38
Message-ID: 31845.1396125518@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

steve k <steven(dot)c(dot)kohler(at)nasa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-03-29 20:47:34 Re: pgsql: Revert "Secure Unix-domain sockets of "make check" temporary clu
Previous Message Noah Misch 2014-03-29 18:39:00 Re: Composite Datums containing toasted fields are a bad idea(?)