Access postgress database in Ubuntu CLI

login as postgres user
$ su - postgres

if you forgot the password you can reset it
$ sudo passwd postgres

Remember that postgres is an os user, and postgres use a system user, postgres do not use its own login

Now login to ppostres console
postgres@user-pc:~$ psql

psql (10.10 (Ubuntu 10.10-0ubuntu0.18.04.1))
Type "help" for help.
postgres=#

list all databases:
postgres=# \l

Create database:
postgres=# create database legendary_dev;

Topic: