Command
psql -h localhost -U username -d databaseExamples
Connect to database
psql -h localhost -U postgres -d mydbConnect with connection string
psql postgresql://user:pass@localhost:5432/mydbpsql -h localhost -U username -d databaseConnect to database
psql -h localhost -U postgres -d mydbConnect with connection string
psql postgresql://user:pass@localhost:5432/mydb