Drew
Drew

Reputation: 2663

Unable To Run PSQL

Whenever I try to run 'psql' I receieve the following error message:

ahcarpenter@ubuntu:~$ psql
psql: FATAL:  role "ahcarpenter" does not exist

Any ideas on how to fix this?

Upvotes: 1

Views: 491

Answers (1)

Clodoaldo Neto
Clodoaldo Neto

Reputation: 125454

That happens because

$ psql 

is equivalent to

$ psql ahcarpenter -U ahcarpenter

As that user does not exist enter as user postgres

$ psql -U postgres

Once inside create the user and the database "ahcarpenter".

create user ahcarpenter;
create database ahcarpenter with owner ahcarpenter;

exit

\q

Reenter

$ psql

Upvotes: 1

Related Questions