PosrtgreSQL - YanMak/knowledge_base GitHub Wiki

Start PostgreSQL prompt by using the command: sudo -i -u postgres switshes root to psql admin, then we can try typing psql in console.

$ psql example: postgres@260197:~$ psql

\q quit PG prompt

systemctl status postgresql.service shows pg process status

\password changes passwod


Inspect database let's use the psql command line interface to inspect the DB. Open a terminal, start the shell with psql, and select the database using the \c [database] command. \c is shorthand for \connect:

\c testdb