aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/print.c')
-rw-r--r--src/bin/psql/print.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index 655850bb2dc..63514e342eb 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -2208,6 +2208,12 @@ PageOutput(int lines, unsigned short int pager)
pagerprog = getenv("PAGER");
if (!pagerprog)
pagerprog = DEFAULT_PAGER;
+ else
+ {
+ /* if PAGER is empty or all-white-space, don't use pager */
+ if (strspn(pagerprog, " \t\r\n") == strlen(pagerprog))
+ return stdout;
+ }
#ifndef WIN32
pqsignal(SIGPIPE, SIG_IGN);
#endif