+1 vote
in Databases by (6k points)

I installed PostgreSQL 11 on my Ubuntu machine, but when I type psql on the terminal to access PostgreSQL, it gives the following error:

psql: FATAL:  role "xxxx" does not exist

What is the command to go to PostgreSQL terminal on Ubuntu?

1 Answer

0 votes
by (10.1k points)

Open the terminal and type the following commands to access PostgreSQL:


$ sudo -i -u postgres

2. It will change the current user to postgres. Then type psql to access PostgreSQL.

$ psql