Noah Misch pointed out something interesting to me: /* * PQputCopyEnd - send EOF indication to the backend during COPY IN * * After calling this, use PQgetResult() to check command completion status. * * Returns 1 if successful, 0 if data could not be sent (only possible * in nonblock mode), or -1 if an error occurs. */
The comment alleges that 0 is a possible return value, but the only return statements in the code for that function return literal values of either 1 or -1. I'm not sure whether that's a bug in the code or the documentation. Also, I noticed that there are a few places in fe-protocol3.c that seem not to know about COPY-BOTH mode. I'm not sure that any of these are actually bugs right now given the current very limited use of COPY-BOTH mode, but I'm wondering whether it wouldn't be better to minimize the chance of future surprises. Patch attached. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
libpq-copy-both.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers