Fix psql's \copy command to ensure that it cycles libpq back to the idle state

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

Commit: df3a6fe477bcb82c76276a1b38714a225cc2cbff
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2006-11-24T23:06:50Z
Releases: 8.2.0
Fix psql's \copy command to ensure that it cycles libpq back to the idle state
(in particular, causing the ReadyForQuery message to be eaten) before
returning from do_copy.  The only known consequence of failing to do so is
that get_prompt might show a wrong result for the %x transaction status
escape, as reported by Bernd Helmle; but it's possible there are other issues.

Back-patch as far as 7.4, the oldest version supporting %x.

Files

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