summaryrefslogtreecommitdiff
path: root/src/bin/psql/print.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1999-12-10 03:59:30 +0000
committerBruce Momjian <bruce@momjian.us>1999-12-10 03:59:30 +0000
commit77a47299366e0246e3ec7419a9f8472281394b1e (patch)
treef68c0692a91f465a5b3b1f4e765f0a7e61e936c4 /src/bin/psql/print.c
parent97dec77fab612cfa285f6bd3dd5463a0d55526b2 (diff)
This should fix the \e (\p, \g, ...) behaviour on an empty query buffer.
Also, minor tweakage of tab completion, and I hope the output is flushed on time now. -- Peter Eisentraut Sernanders väg 10:115
Diffstat (limited to 'src/bin/psql/print.c')
-rw-r--r--src/bin/psql/print.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index 481f76f343e..15d40a806a9 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -18,7 +18,7 @@
#include <libpq-fe.h>
#include <postgres_ext.h> /* for Oid type */
-#define DEFAULT_PAGER "/bin/more"
+#define DEFAULT_PAGER "more"
@@ -325,6 +325,11 @@ print_aligned_vertical(const char *title, const char * const * headers,
dwidth = 0;
char *divider;
+ if (cells[0] == NULL) {
+ puts("(No rows)\n");
+ return;
+ }
+
/* count columns and find longest header */
for (ptr = headers; *ptr; ptr++)
{