What command or short key can I use to exit the PostgreSQL command line utility psql
?
Specifically speaking, how to exit from the following status on Ubuntu 18.04.
I put the original status as follows.
postgres@user:~$
If psql is inputed, it changes to the new status as follows.
postgres@user:~$ psql
postgres=#
If \q is inputed, please see the operation.
postgres@user:~$ \q
It changes to the original status as follows.
postgres@user:~$
The quick way is to kill the terminal. But I want to know other quit method without killing the terminal.
Thanks,
Try:
TSTP
signal (TSTP
is short for “terminal stop”)QUIT
signalFor curiosity:
EOF
character. EOF
stands for "end of file". In this concrete case it exits from the psql subprogram, as the shell is waiting for user input. This should not be 'the way to go' as it is not working if:
Ctrl+D is what I usually use to exit psql console.