aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-04-04 16:15:04 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-04-04 16:15:04 -0400
commitcb917e1544612c187c74fed1a990e26820514c8a (patch)
tree03a1fca64bb18de79f698864ca0037d0f43dc8a5 /src
parentc17e863bc7677a54d6da5bbb2868cca2cd9b30c1 (diff)
downloadpostgresql-cb917e1544612c187c74fed1a990e26820514c8a.tar.gz
postgresql-cb917e1544612c187c74fed1a990e26820514c8a.zip
Remove useless PGRES_COPY_BOTH "support" in psql.
There is no existing or foreseeable case in which psql should see a PGRES_COPY_BOTH PQresultStatus; and if such a case ever emerges, it's a pretty good bet that these code fragments wouldn't do the right thing anyway. Remove them, and let the existing default cases do the appropriate thing, namely emit an "unexpected PQresultStatus" bleat. Noted while working on libpq row processor patch, for which I was considering adding a PGRES_SUSPENDED status code --- the same default-case treatment would be appropriate for that.
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/common.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 715e23167de..33dc97e95f2 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -450,7 +450,6 @@ AcceptResult(const PGresult *result)
case PGRES_EMPTY_QUERY:
case PGRES_COPY_IN:
case PGRES_COPY_OUT:
- case PGRES_COPY_BOTH:
/* Fine, do nothing */
OK = true;
break;
@@ -673,29 +672,17 @@ ProcessResult(PGresult **results)
result_status = PQresultStatus(*results);
switch (result_status)
{
- case PGRES_COPY_BOTH:
- /*
- * No now-existing SQL command can yield PGRES_COPY_BOTH, but
- * defend against the future. PQexec() can't short-circuit
- * it's way out of a PGRES_COPY_BOTH, so the connection will
- * be useless at this point. XXX is there a method for
- * clearing this status that's likely to work with every
- * future command that can initiate it?
- */
- psql_error("unexpected PQresultStatus (%d)", result_status);
- return false;
-
- case PGRES_COPY_OUT:
- case PGRES_COPY_IN:
- is_copy = true;
- break;
-
case PGRES_EMPTY_QUERY:
case PGRES_COMMAND_OK:
case PGRES_TUPLES_OK:
is_copy = false;
break;
+ case PGRES_COPY_OUT:
+ case PGRES_COPY_IN:
+ is_copy = true;
+ break;
+
default:
/* AcceptResult() should have caught anything else. */
is_copy = false;
@@ -817,7 +804,6 @@ PrintQueryResults(PGresult *results)
case PGRES_COPY_OUT:
case PGRES_COPY_IN:
- case PGRES_COPY_BOTH:
/* nothing to do here */
success = true;
break;