sudo su - postgres
psql

\x expanded display

\list or \l: list all databases

\dt: list all tables in the current database

You will never see tables in other databases, these tables aren’t visible. You have to connect to the correct database to see its tables (and other objects).

To switch databases:

\connect DATABASE_NAME

CREATE USER USERNAME WITH PASSWORD 'PASSWORD';
CREATE DATABASE DBNAME OWNER USERNAME;
GRANT ALL PRIVILEGES ON DATABASE DBNAME TO USERNAME;


If you want to change the password:
alter user USERNAME with encrypted password 'PASSWORD';

 

\q quits the console.