progname, PQerrorMessage(conn));
disconnect_and_exit(1);
}
- if (PQntuples(res) != 1)
+ if (PQntuples(res) != 1 || PQnfields(res) != 3)
{
- fprintf(stderr, _("%s: could not identify system, got %i rows\n"),
- progname, PQntuples(res));
+ fprintf(stderr, _("%s: could not identify system, got %i rows and %i fields\n"),
+ progname, PQntuples(res), PQnfields(res));
disconnect_and_exit(1);
}
sysidentifier = strdup(PQgetvalue(res, 0, 0));
{
fprintf(stderr, _("%s: could not parse xlog end position \"%s\"\n"),
progname, xlogend);
- exit(1);
+ disconnect_and_exit(1);
}
InterlockedIncrement(&has_xlogendptr);
/*
* End of copy data. Final result is already checked inside the loop.
*/
+ PQclear(res);
PQfinish(conn);
if (verbose)
progname, PQerrorMessage(conn));
disconnect_and_exit(1);
}
- if (PQntuples(res) != 1)
+ if (PQntuples(res) != 1 || PQnfields(res) != 3)
{
- fprintf(stderr, _("%s: could not identify system, got %i rows\n"),
- progname, PQntuples(res));
+ fprintf(stderr, _("%s: could not identify system, got %i rows and %i fields\n"),
+ progname, PQntuples(res), PQnfields(res));
disconnect_and_exit(1);
}
timeline = atoi(PQgetvalue(res, 0, 1));
PQclear(res);
return false;
}
+ if (PQnfields(res) != 3 || PQntuples(res) != 1)
+ {
+ fprintf(stderr, _("%s: could not identify system, got %i rows and %i fields\n"),
+ progname, PQntuples(res), PQnfields(res));
+ PQclear(res);
+ return false;
+ }
if (strcmp(sysidentifier, PQgetvalue(res, 0, 0)) != 0)
{
fprintf(stderr, _("%s: system identifier does not match between base backup and streaming connection\n"), progname);