aboutsummaryrefslogtreecommitdiff
path: root/src/test/examples/testlibpq.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-10-01 17:34:19 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-10-01 17:34:19 +0000
commit8bbfa16624e57921712d350b757e11c6258b4561 (patch)
tree4c0db6ea3218c251cc48556939fe38a24e37785e /src/test/examples/testlibpq.c
parentbbd1e1cc6844cddcf68fd2771860036df6ac62eb (diff)
downloadpostgresql-8bbfa16624e57921712d350b757e11c6258b4561.tar.gz
postgresql-8bbfa16624e57921712d350b757e11c6258b4561.zip
Don't assume PQdb() will return a valid result from a failed connection.
Diffstat (limited to 'src/test/examples/testlibpq.c')
-rw-r--r--src/test/examples/testlibpq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/examples/testlibpq.c b/src/test/examples/testlibpq.c
index f650118a29e..b9d396a2dcb 100644
--- a/src/test/examples/testlibpq.c
+++ b/src/test/examples/testlibpq.c
@@ -41,8 +41,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);
}