diff options
-rw-r--r-- | src/bin/psql/copy.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c index 57593d111c1..7207bb3e02d 100644 --- a/src/bin/psql/copy.c +++ b/src/bin/psql/copy.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2009, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.80 2009/04/26 15:31:50 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.80.2.1 2009/08/07 20:16:16 tgl Exp $ */ #include "postgres_fe.h" #include "copy.h" @@ -571,6 +571,9 @@ do_copy(const char *args) success = false; psql_error("\\copy: unexpected response (%d)\n", PQresultStatus(result)); + /* if still in COPY IN state, try to get out of it */ + if (PQresultStatus(result) == PGRES_COPY_IN) + PQputCopyEnd(pset.db, _("trying to exit copy mode")); PQclear(result); } |