When using Psql in Linux, if the result of my SQL query contains many columns or long strings of data, it will wrap the initial view and only once I scroll to the side will it s
less's -F
or -S
flag will causes \d some_table
to not show any output in some cases.
-F or --quit-if-one-screen
Causes less to automatically exit if the entire file can be
displayed on the first screen.
-S or --chop-long-lines
Causes lines longer than the screen width to be chopped rather than folded.
That is, the portion of a long line that does not fit in the screen width is
not shown. The default is to fold long lines; that is, display the remainder
on the next line.
Use them like this:
PAGER="less -S" psql
Seems safer at the inconvenience of having to manually exit less.