From 5e8304fdce2d5c41ef7a648ed0a622480f8f0a07 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 5 Sep 2017 12:02:06 -0400 Subject: 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 --- src/interfaces/libpq/fe-print.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/interfaces') 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 && -- cgit v1.2.3