Иван Петров
Иван Петров

Reputation: 547

How to exit from query result viewer in psql?

First query:

database=# select * from table limit 1;
...
 |
(1 row)

(END)

I want to make a second query but I can't. ctrl+Z exits from psql. What can I press to exit only from result viewing?

Upvotes: 34

Views: 31069

Answers (1)

andreas-hofmann
andreas-hofmann

Reputation: 2518

Hit q. This closes many vim-like pagers, not only in psql, but also e.g. in 'less', 'git log', 'mutt', and many more.

Just FYI: Hitting Ctrl + Z does not exit psql, it just suspends it and sends it to background. The program continues to run, and you can resume it by entering 'fg'. In Unix environments, Ctrl + C is usually the way to forcibly stop a program.

Upvotes: 74

Related Questions