0

This is a minor issue, but it's driving me nuts.

Anyways, on some of my servers I'm running PostgreSQL 8.4. When using PSQL (also 8.4), queries are shown with a less-like interface, which I'm quite happy with.

However, on my newer servers I'm running PostgreSQL 9.3, and PSQL (also 9.3) has slightly changed up how it views the queries: Similar less-like interface, but when I hit q to exit it clears the results from the screen. This drives me nuts; I often will run a SELECT query and use the results to write an UPDATE or DELETE query, which is made much more difficult when I can't see the results while I'm writing the query.

Is there any way I can change this?

1 Answer 1

0

This is behaviour of your pager, not PostgreSQL or psql.

You can tell psql not to use a pager at all with:

\pset pager off

(this can go in your .psqlrc to make it persistent). That'll potentially result in long, uncontrollable scrolling results though.

To instead tell the pager less, which I'm guessing is your default, not to clear the screen, see this related answer.

1
  • Great, export PAGER="less -X" worked perfectly. Feb 7, 2014 at 20:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .