0

I recently installed Ubuntu and PostgreSQL. I'm trying to pull up my PostgreSQL database. If I type rails db I get this error

psql: FATAL: database "homed_in_development" does not exist

So I then try running rake db:create or rake db:migrate but I get the error

PG::InsufficientPrivilege: ERROR: permission denied to create database

So I have tried CREATE ROLE myusername; after getting into PostgreSQL through the common psql postgres, which gives me the error ERROR: permission denied to create role. I tried to fix this issue using ALTER USER myusername WITH SUPERUSER, but I got the error message ERROR: must be superuser to alter superusers

I also got the error FATAL: role “myusername” does not exist on something else, and so I think my issues are that I haven't got roles or permissions set up properly.

7
  • I typed in SELECT current_user; to check what my current username is and it is the username that it says does not exist (Role...myusername does not exist...) Commented May 13, 2014 at 22:38
  • 1
    is this the first project you are using postgres? do you have previous project that you used pg in this machine? Commented May 13, 2014 at 22:49
  • @WaliAli I made the project on another machine and am now using this new machine. Commented May 13, 2014 at 22:55
  • 1
    see if this helps you Commented May 13, 2014 at 22:58
  • 1
    So it worked? good work! Commented May 13, 2014 at 23:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.