PQputCopyEnd returns 1 or -1, never 0, I guess the comment wascopy/paste from PQputCopyData's comment, this should be fixed.
-- RegardsJunwang Zhao