Controls use of a pager program for query and
psql>
- help output. If the environment variable PAGER
- is set, the output is piped to the specified program.
- Otherwise a platform-dependent default (such as
- more) is used.
+ help output. If the environment variable PSQL_PAGER
+ or PAGER is set, the output is piped to the
+ specified program. Otherwise a platform-dependent default program
+ (such as more) is used.
-
- PAGER
-
-
- If the query results do not fit on the screen, they are piped
- through this command. Typical values are
- more or less. The default
- is platform-dependent. Use of the pager can be disabled by setting
- PAGER to empty, or by using pager-related options of
- the \pset command.
-
-
-
-
PGDATABASE
PGHOST
and \ev commands.
These variables are examined in the order listed;
the first that is set is used.
-
-
- The built-in default editors are vi on Unix
- systems and notepad.exe on Windows systems.
+ If none of them is set, the default is to use vi
+ on Unix systems or notepad.exe on Windows systems.
+
+ PSQL_PAGER
+ PAGER
+
+
+ If a query's results do not fit on the screen, they are piped
+ through this command. Typical values are more
+ or less.
+ Use of the pager can be disabled by setting PSQL_PAGER
+ or PAGER to an empty string, or by adjusting the
+ pager-related options of the \pset command.
+ These variables are examined in the order listed;
+ the first that is set is used.
+ If none of them is set, the default is to use more> on most
+ platforms, but less> on Cygwin.
+
+
+
+
+
PSQLRC
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"
" 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"
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 &&