How to access postgreSQL in CLI

Assumption:

item value
postgreSQL server localhost:5432
username user1
password pass1
database db1

Command:

PGPASSWORD=pass1 psql -h localhost -p 5432 -U user1 -d db1
Posted on 2022-03-22