Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keystroke to clear screen in psql?

I want a shortcut key to clear the screen in my (Windows 7) psql console just like CTRL-l clears the screen in my R console. I am tired of typing '! cls'. Do I need to write a macro for this? I am running Postgres 9.35. '\r' resets the query buffer but does not clear the screen. Thanks in advance for your help, sorry if I have just missed something simple.

like image 929
rferrisx Avatar asked Sep 26 '14 17:09

rferrisx


People also ask

How do I clear the screen in PostgreSQL?

Use \! cls to clear screen.

How do you clear the screen in SQL shell?

The Clear command clears the screen of the SQL*Plus application window and the screen buffer. Shift+Del is the keyboard shortcut for the Clear command.

How do I get out of psql mode?

The meta-command for exiting psql is \q .


2 Answers

As an alternative to Ctrl-L use, e.g. for scripts in an linux environment:

\! clear 

or

\! cls 

for Microsoft.

like image 151
Hartmut Pfarr Avatar answered Sep 17 '22 17:09

Hartmut Pfarr


Please use: CTRL + L

Check out the link: http://postgresql.nabble.com/psql-in-bash-how-to-clear-screen-td2141886.html

like image 37
Kevin Guto Avatar answered Sep 16 '22 17:09

Kevin Guto