diff options
| author | Tom Lane | 2017-09-05 16:02:06 +0000 |
|---|---|---|
| committer | Tom Lane | 2017-09-05 16:02:13 +0000 |
| commit | 5e8304fdce2d5c41ef7a648ed0a622480f8f0a07 (patch) | |
| tree | bc6729d626efd6e1ba9bda47a2e518fa49d97259 /src/fe_utils | |
| parent | ebd346caf41b8e8738a49d96797ceccd04bb04dc (diff) | |
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
Diffstat (limited to 'src/fe_utils')
| -rw-r--r-- | src/fe_utils/print.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fe_utils/print.c b/src/fe_utils/print.c index f756f767e5..8af5bbe97e 100644 --- a/src/fe_utils/print.c +++ b/src/fe_utils/print.c @@ -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 |
