diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-11-08 19:12:21 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-11-08 19:12:21 +0000 |
commit | b26dfbb0e3204c170e7928b7156521fa18b744bf (patch) | |
tree | c2d9c9cad2ac87267cd2af6936a43797c2b2e32d /src/bin/psql/command.c | |
parent | c2b716ab6834b40a6ff6e807b7c5344da224fa6e (diff) | |
download | postgresql-b26dfbb0e3204c170e7928b7156521fa18b744bf.tar.gz postgresql-b26dfbb0e3204c170e7928b7156521fa18b744bf.zip |
Here is a patch that does just that, while maintaining the
"traditional" behavior, so the change should be transparent. Use the
command "\pset pager always" to turn it on. Anything else does the
normal toggle between "on" and "off"
Greg Sabino Mullane
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r-- | src/bin/psql/command.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 83ce799e51c..bfe5b45e1ef 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3,7 +3,7 @@ * * Copyright 2000-2002 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.84 2002/10/23 19:23:56 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.85 2002/11/08 19:12:21 momjian Exp $ */ #include "postgres_fe.h" #include "command.h" @@ -1873,11 +1873,18 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) /* toggle use of pager */ else if (strcmp(param, "pager") == 0) { - popt->topt.pager = !popt->topt.pager; + if (value && strcasecmp(value, "always") == 0) + popt->topt.pager = 2; + else if (popt->topt.pager == 1) + popt->topt.pager = 0; + else + popt->topt.pager = 1; if (!quiet) { - if (popt->topt.pager) + if (popt->topt.pager == 1) puts(gettext("Using pager is on.")); + else if (popt->topt.pager == 2) + puts(gettext("Using pager is always.")); else puts(gettext("Using pager is off.")); } |