Reputation: 8517
I can't set less
as pager in psql.
This is my environment:
~/.psqlrc
contents:
# \setenv PAGER less
\x auto
\timing
\set VERBOSITY verbose
\pset null 'NULL'
\pset pager on
\set HISTSIZE
\set PROMPT1 '(%n@%M:%>) [%/] > '
\set PROMPT2 '%[%033[8m%](%n@%M:%>) [%/] >[%033[0m%]%'
env | grep PAGER
:
PAGER=less
Neverthless this, when I digit \dSpaceTabTaby I get:
table another_table
table another_table
...
--More--
Upvotes: 14
Views: 8164
Reputation: 11
Using the postgres command line client , psql
\o |less -S -X && stty sane
Upvotes: 1
Reputation: 11
Another case is when you got error in psql.exe:
'less' is not recognized as an internal or external command
when trying to get some result by SQL:
Easy solution is turn off pager:
\pset pager off
DONE!
Upvotes: 0
Reputation: 61616
The display of this line (--More--
) and the forward-only scrolling capability in tab-completion come from the internal pager of the readline
library, as opposed to an external pager. psql
lets this library handle the UI-side of tab-completion.
This paging may be turned off in .inputrc
with set page-completions to off
, but it's not replaceable by an external program, at least not in the current versions of GNU readline.
In the context of displaying query results, the PAGER
environment variable normally works as documented.
Upvotes: 7