PSQL 8.3+ client query results display
Asked Answered
M

3

15

Rather silly question, but I can't seem to find the answer in the docs or man pages.

Starting with 8.3 I think, the psql CLI client will not display the results of a large query inline. It pipes to a 'less-like' result viewer that disappears when you hit q.

This makes it very difficult to use data from the first query in subsequent queries or updates.

Does anyone know of a switch or way to force psql to display the query results inline, like the old client did?

edit: the \x switch does this, but I need the multiple row view.

Miaow answered 30/12, 2009 at 20:58 Comment(0)
T
23

\pset pager off

\pset pager on

\pset pager always

Alternatively, configure the pager to your liking.

Telfer answered 30/12, 2009 at 21:7 Comment(0)
I
4

in addition to \pset pager always add the following in your .profile (or .bashrc)

export PAGER=less

export LESS="-iMSx4 -FX"
Immature answered 24/10, 2012 at 13:43 Comment(0)
S
1

You can also disable it when you start up psql:

$ psql -U admin db_name --pset pager=off

If you always want it to be off, you can add this to your .bashrc file:

alias psql='psql --pset pager=off'
Strategy answered 2/2, 2012 at 21:43 Comment(1)
A better place to put this is in your .psqlrc, i.e.: \pset pager offDay

© 2022 - 2024 — McMap. All rights reserved.