Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb917e1

Browse files
committed
Remove useless PGRES_COPY_BOTH "support" in psql.
There is no existing or foreseeable case in which psql should see aPGRES_COPY_BOTH PQresultStatus; and if such a case ever emerges, it's apretty good bet that these code fragments wouldn't do the right thinganyway. Remove them, and let the existing default cases do the appropriatething, namely emit an "unexpected PQresultStatus" bleat.Noted while working on libpq row processor patch, for which I wasconsidering adding a PGRES_SUSPENDED status code --- the same default-casetreatment would be appropriate for that.
1 parentc17e863 commitcb917e1

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

‎src/bin/psql/common.c

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ AcceptResult(const PGresult *result)
450450
casePGRES_EMPTY_QUERY:
451451
casePGRES_COPY_IN:
452452
casePGRES_COPY_OUT:
453-
casePGRES_COPY_BOTH:
454453
/* Fine, do nothing */
455454
OK= true;
456455
break;
@@ -673,29 +672,17 @@ ProcessResult(PGresult **results)
673672
result_status=PQresultStatus(*results);
674673
switch (result_status)
675674
{
676-
casePGRES_COPY_BOTH:
677-
/*
678-
* No now-existing SQL command can yield PGRES_COPY_BOTH, but
679-
* defend against the future. PQexec() can't short-circuit
680-
* it's way out of a PGRES_COPY_BOTH, so the connection will
681-
* be useless at this point. XXX is there a method for
682-
* clearing this status that's likely to work with every
683-
* future command that can initiate it?
684-
*/
685-
psql_error("unexpected PQresultStatus (%d)",result_status);
686-
return false;
687-
688-
casePGRES_COPY_OUT:
689-
casePGRES_COPY_IN:
690-
is_copy= true;
691-
break;
692-
693675
casePGRES_EMPTY_QUERY:
694676
casePGRES_COMMAND_OK:
695677
casePGRES_TUPLES_OK:
696678
is_copy= false;
697679
break;
698680

681+
casePGRES_COPY_OUT:
682+
casePGRES_COPY_IN:
683+
is_copy= true;
684+
break;
685+
699686
default:
700687
/* AcceptResult() should have caught anything else. */
701688
is_copy= false;
@@ -817,7 +804,6 @@ PrintQueryResults(PGresult *results)
817804

818805
casePGRES_COPY_OUT:
819806
casePGRES_COPY_IN:
820-
casePGRES_COPY_BOTH:
821807
/* nothing to do here */
822808
success= true;
823809
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp