From b26dfbb0e3204c170e7928b7156521fa18b744bf Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 8 Nov 2002 19:12:21 +0000 Subject: 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 --- src/bin/psql/command.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/bin/psql/command.c') 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.")); } -- cgit v1.2.3