skip to Main Content

On Ubuntu, running psql from command line, when I type in ‘d {tableName}’ it takes me to some viewer mode similar to vi where I have to then hit ‘q’ to go back. Then I lose the list of columns that I was just seeing and am back to the console.

Is there some way to have it like it is on CentOS where the output of
‘d {tableName}’ is a simple query that writes output onto the console and stays there?

2

Answers


  1. It depends on pager configuration. You should to check content of PAGER variable.

    set | grep PAGER
    

    If you use a pspg pager, then a option -X disables returning original content of display when the pager is ended. Same option has a pager less.

    One of good configuration for less pager can be

    export PAGER="less"
    export LESS="-iMSx4 -FX"
    
    Login or Signup to reply.
  2. That viewer mode is called a pager.

    You can disable it in the psql shell with

    pset pager off
    

    or when starting psql by passing the pset flag:

    psql --pset pager=off
    

    pset is used to specify printing options. See the docs on psql for more.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search