1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Don't assume PQdb() will return a valid result from a failed connection.

This commit is contained in:
Tom Lane
2004-10-01 17:34:19 +00:00
parent bbd1e1cc68
commit 8bbfa16624
6 changed files with 20 additions and 20 deletions

View File

@@ -61,8 +61,8 @@ main(int argc, char **argv)
/* Check to see that the backend connection was successfully made */
if (PQstatus(conn) != CONNECTION_OK)
{
fprintf(stderr, "Connection to database '%s' failed.\n", PQdb(conn));
fprintf(stderr, "%s", PQerrorMessage(conn));
fprintf(stderr, "Connection to database failed: %s",
PQerrorMessage(conn));
exit_nicely(conn);
}