1

I learn from tutorials, often when they type commands in terminal and press enter, the operation is executed and they can type next command. I often get stuck on these screens (often ctlr+c helps, but on the image below doesn't).

image

Commands like \l, service postgresql status do that.

Can anybody explain why people in tutorials don't have that and how do I exit these things?

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
Max
  • 63
  • 1
  • 1
  • 7
  • Anybody? Can't do a thing after \l in psql – Max Mar 04 '19 at 10:24
  • This maybe? https://stackoverflow.com/questions/12472026 –  Mar 04 '19 at 11:36
  • 1
    `service postgresql status` is **not** a `psql` (or SQL) command, but a Linux command. You can't run that inside psql. Your screenshot shows the output of a command displayed through the pager. The pager is typically ended by pressing `q` –  Mar 04 '19 at 11:38

1 Answers1

2

This looks like you are "stuck" in the pager less. Try typing q to get back to the psql prompt.

Whenever a result set is to long or too wide for the screen, psql will call the configured pager to paginate the result set.

You can disable this feature with

\pset pager off

on the psql prompt or in your ~/.psqlrc file.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263