Try to defend against the possibility that libpq is still in COPY_IN state

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 35e82ff9b5c29b2f58bf974192ec5701e515a417
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-08-07T20:16:16Z
Releases: 8.4.1
Try to defend against the possibility that libpq is still in COPY_IN state
when we reach the post-COPY "pump it dry" error recovery code that was added
2006-11-24.  Per a report from Neil Best, there is at least one code path
in which this occurs, leading to an infinite loop in code that's supposed
to be making it more robust not less so.  A reasonable response seems to be
to call PQputCopyEnd() again, so let's try that.

Back-patch to all versions that contain the cleanup loop.

Files

PathChange+/−
src/bin/psql/copy.c modified +4 −1