summaryrefslogtreecommitdiff
path: root/src/bin/psql/tab-complete.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-08-16 01:36:35 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-08-16 01:36:35 +0000
commit63c3b9903b47d12b92ea8cd407aeffbcde2a5784 (patch)
treedbb76d06553c11856700325bf42b01ac8fc6ff1d /src/bin/psql/tab-complete.c
parentb9984ade83519a04f89ffdfe3c043fcbdafc65db (diff)
Fix a couple of places where psql might fail to report a suitable error
if PQexec returns NULL. These don't seem significant enough to be worth back-patching, but they ought to get fixed ...
Diffstat (limited to 'src/bin/psql/tab-complete.c')
-rw-r--r--src/bin/psql/tab-complete.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 2a036e279d6..97d9f13d7a1 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.170 2008/03/29 19:19:14 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.171 2008/08/16 01:36:35 tgl Exp $
*/
/*----------------------------------------------------------------------
@@ -2577,11 +2577,11 @@ exec_query(const char *query)
result = PQexec(pset.db, query);
- if (result != NULL && PQresultStatus(result) != PGRES_TUPLES_OK)
+ if (PQresultStatus(result) != PGRES_TUPLES_OK)
{
#if 0
- psql_error("tab completion: %s failed - %s\n",
- query, PQresStatus(PQresultStatus(result)));
+ psql_error("tab completion query failed: %s\nQuery was:\n%s\n",
+ PQerrorMessage(pset.db), query);
#endif
PQclear(result);
result = NULL;