1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-16 16:42:29 +03:00

Fixed a few "fixes" and bugs. Adjusted messages and options to GNU suggestions.

This commit is contained in:
Peter Eisentraut
2000-01-12 19:36:36 +00:00
parent 267c6c7f06
commit f6689a328f
24 changed files with 615 additions and 594 deletions

View File

@@ -491,9 +491,6 @@ SendQuery(PsqlSettings *pset, const char *query)
break;
case PGRES_COPY_OUT:
if (pset->cur_cmd_interactive && !GetVariableBool(pset->vars, "quiet"))
puts("Copy command returns:");
success = handleCopyOut(pset->db, pset->queryFout);
break;
@@ -510,7 +507,7 @@ SendQuery(PsqlSettings *pset, const char *query)
case PGRES_FATAL_ERROR:
case PGRES_BAD_RESPONSE:
success = false;
fputs(PQerrorMessage(pset->db), pset->queryFout);
fputs(PQerrorMessage(pset->db), stderr);
break;
}
@@ -518,6 +515,11 @@ SendQuery(PsqlSettings *pset, const char *query)
if (PQstatus(pset->db) == CONNECTION_BAD)
{
if (!pset->cur_cmd_interactive)
{
fprintf(stderr, "%s: connection to server was lost", pset->progname);
exit(EXIT_BADCONN);
}
fputs("The connection to the server was lost. Attempting reset: ", stderr);
PQreset(pset->db);
if (PQstatus(pset->db) == CONNECTION_BAD)