diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/help.c | 4 | ||||
-rw-r--r-- | src/fe_utils/print.c | 4 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-print.c | 7 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index 724cf8e761e..9d366180af5 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -459,8 +459,6 @@ helpVariables(unsigned short int pager) fprintf(output, _(" COLUMNS\n" " number of columns for wrapped format\n")); - fprintf(output, _(" PAGER\n" - " name of external pager program\n")); fprintf(output, _(" PGAPPNAME\n" " same as the application_name connection parameter\n")); fprintf(output, _(" PGDATABASE\n" @@ -481,6 +479,8 @@ helpVariables(unsigned short int pager) " how to specify a line number when invoking the editor\n")); fprintf(output, _(" PSQL_HISTORY\n" " alternative location for the command history file\n")); + fprintf(output, _(" PSQL_PAGER, PAGER\n" + " name of external pager program\n")); fprintf(output, _(" PSQLRC\n" " alternative location for the user's .psqlrc file\n")); fprintf(output, _(" SHELL\n" diff --git a/src/fe_utils/print.c b/src/fe_utils/print.c index f756f767e57..8af5bbe97ea 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 diff --git a/src/interfaces/libpq/fe-print.c b/src/interfaces/libpq/fe-print.c index 89bc4c54299..6dbf8472800 100644 --- a/src/interfaces/libpq/fe-print.c +++ b/src/interfaces/libpq/fe-print.c @@ -165,6 +165,13 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po) screen_size.ws_row = 24; screen_size.ws_col = 80; #endif + + /* + * Since this function is no longer used by psql, we don't examine + * PSQL_PAGER. It's possible that the hypothetical external users + * of the function would like that to happen, but in the name of + * backwards compatibility, we'll stick to just examining PAGER. + */ pagerenv = getenv("PAGER"); /* if PAGER is unset, empty or all-white-space, don't use pager */ if (pagerenv != NULL && |