Failure creating "vagrant" role in postgres

Hello, I'm stuck on this part of creating user: I get the message: createuser: creation of new role failed: ERROR: role "vagrant" already exists What to do now?

Sorry You must be a logged in, registered user to answer a question.

Answers

After "sudo su postgres", go ahead and run "dropuser vagrant" sans quotes then continue on with the the tutorial. I imagine you can alter the role of the existing vagrant user but this worked as well

$ sudo -u postgres psql
psql (9.1.9)
Type "help" for help.
postgres=# ALTER ROLE vagrant CREATEUSER CREATEDB;
ALTER ROLE
postgres=# \q
(blog-venv)vagrant@precise64:/vagrant/projects/microblog$ psql -U vagrant templ
ate1
psql (9.1.9)
Type "help" for help.
template1=# \q
(blog-venv)vagrant@precise64:/vagrant/projects/microblog$ createdb microblog
(blog-venv)vagrant@precise64:/vagrant/projects/microblog$

I would suggest dropping that user and creating a new one, then.

  1. sudo su postgres
  2. dropuser vagrant
  3. follow the instructions in the video for creating the vagrant user as a superuser.

Either drop that user or just use it. The "vagrant" role's password should be "gswd".

try the dropuser and then create superuser vagrant again, it worked for me
JuanPabloMF on
But then I get this message: (blog-venv)vagrant@precise64:/vagrant/projects/microblog$ createdb microblog createdb: database creation failed: ERROR: permission denied to create database
eduardovs on