*
*
* 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
*
} else {
copydone = false;
while (!copydone) {
- ret = PQgetline(res->conn, copybuf, COPYBUFSIZ);
-
+ ret = PQgetline(res->conn, copybuf, COPYBUFSIZ);
+
if (copybuf[0] == '\\' &&
copybuf[1] == '.' &&
copybuf[2] == '\0') {
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);
+ }
}
}
int i;
char *all_only;
- if (onlytable == NULL)
- all_only = "all";
+ if (onlytable == NULL) all_only = "all";
else all_only = "one";
if (g_verbose)
for(i = 0; i < numTables; i++) {
const char *classname = tblinfo[i].relname;
-
+
if (!onlytable || (!strcmp(classname,onlytable))) {
if (g_verbose)
fprintf(stderr, "%s dumping out the contents of Table %s %s\n",