Check that PQendcopy succeeded. Issue error message if not.
This commit is contained in:
parent
765dd2a4c0
commit
7ab0ceb824
@ -20,7 +20,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* 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");
|
fprintf(fout, "\\.\n");
|
||||||
}
|
}
|
||||||
PQclear(res);
|
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;
|
int i;
|
||||||
char *all_only;
|
char *all_only;
|
||||||
|
|
||||||
if (onlytable == NULL)
|
if (onlytable == NULL) all_only = "all";
|
||||||
all_only = "all";
|
|
||||||
else all_only = "one";
|
else all_only = "one";
|
||||||
|
|
||||||
if (g_verbose)
|
if (g_verbose)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user