1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

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
This commit is contained in:
Bruce Momjian
2002-11-08 19:12:21 +00:00
parent c2b716ab68
commit b26dfbb0e3
7 changed files with 34 additions and 26 deletions

View File

@ -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."));
}