1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

In psql, use PSQL_PAGER in preference to PAGER, if it's set.

This allows the user's environment to set up a psql-specific choice
of pager, in much the same way that we provide PSQL_EDITOR to allow
a psql-specific override of the more widely known EDITOR variable.

Pavel Stehule, reviewed by Thomas Munro

Discussion: https://postgr.es/m/CAFj8pRD3RRk9S1eRbnGm_T6brc3Ss5mohraNzTSJquzx+pmtKA@mail.gmail.com
This commit is contained in:
Tom Lane
2017-09-05 12:02:06 -04:00
parent ebd346caf4
commit 5e8304fdce
4 changed files with 39 additions and 27 deletions

View File

@ -2870,7 +2870,9 @@ PageOutput(int lines, const printTableOpt *topt)
const char *pagerprog;
FILE *pagerpipe;
pagerprog = getenv("PAGER");
pagerprog = getenv("PSQL_PAGER");
if (!pagerprog)
pagerprog = getenv("PAGER");
if (!pagerprog)
pagerprog = DEFAULT_PAGER;
else