Check that PQendcopy succeeded. Issue error message if not.

This commit is contained in:
Bryan Henderson 1996-12-30 23:05:16 +00:00
parent 765dd2a4c0
commit 7ab0ceb824
1 changed files with 15 additions and 7 deletions

View File

@ -20,7 +20,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.20 1996/12/28 22:44:58 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.21 1996/12/30 23:05:16 bryanh Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
@ -184,7 +184,16 @@ dumpClasses_nodumpData(FILE *fout, const char *classname, const bool oids) {
fprintf(fout, "\\.\n");
}
PQclear(res);
PQendcopy(res->conn);
ret = PQendcopy(res->conn);
if (ret != 0) {
fprintf(stderr, "SQL query to dump the contents of Table %s "
"did not execute correctly. After we read all the "
"table contents from the backend, PQendcopy() failed. "
"Explanation from backend: '%s'.\n"
"The query was: '%s'.\n",
classname, PQerrorMessage(g_conn), query);
exit_nicely(g_conn);
}
}
}
@ -287,8 +296,7 @@ dumpClasses(const TableInfo tblinfo[], const int numTables, FILE *fout,
int i;
char *all_only;
if (onlytable == NULL)
all_only = "all";
if (onlytable == NULL) all_only = "all";
else all_only = "one";
if (g_verbose)