Monday, September 7, 2009

output console psql postgresql / editor

this post i read really makes psql better:

you could also try PAGER="more", i used to like it better

A better psql with less
psql is a great tool, but not very good at browsing data. Or is it? The following settings will make psql much more usable.

in your user profile:
export PAGER=less
export LESS="-iMSx4 -FX"

in your .psqlrc (make it if it's not already there)

\pset pager always

log in into psql ...



  1. update:

    i find it a lot more useful not using the S option... S = chop long lines, i like then folded...

    whener you press right arrow key, the lines are show non-folded

  2. another useful option with less is the -#, which controls the amount of characters to the left or right that less shifts when the arrow is pressed...

    this can be also set dinamically, by pressing ESC 10 RIGHTARROW (moves 10 characters to the right)