Disable wrapping in Psql output

Psql uses a system viewer to show its output in the console. In bash it likely uses less for the scrollable/page-able features it provides. To use a different viewer or use different settings, you just need to set the PAGER environment variable.

Running psql to use less with the -S or --chop-long-lines option seemed to work for me:

PAGER="less -S" psql

You can also toggle this feature while viewing output in less by typing -S and Enter.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)