"postgres is not in the sudoers file. This incident will be reported." after I dropuser vagrant
Initially, I got this issue: http://gettingstartedwithdjango.com/questions/1/failure-creating-vagrant-role-in-postgres/
In other words: createuser: creation of new role failed: ERROR: role "vagrant" already exists postgres@precise64:/vagrant/projects/microblog$ createuser -P could not change directory to "/vagrant/projects/microblog" Enter name of role to add: admin Enter password for new role: Enter it again: Shall the new role be a superuser? (y/n) y
So as you can see above, I ended up creating a new user called 'admin.'
Next, when I tried to create a database for the microblog, I got:
(blog-venv)vagrant@precise64:/vagrant/projects/microblog$ createdb microblog createdb: database creation failed: ERROR: permission denied to create database
So, referring to the previous question asked on these forums above, I dropped the vagrant user:
(blog-venv)vagrant@precise64:/vagrant/projects/microblog$ sudo su postgres postgres@precise64:/vagrant/projects/microblog$ dropuser vagrant could not change directory to "/vagrant/projects/microblog" postgres@precise64:/vagrant/projects/microblog$ sudo -u postgres psql postgres is not in the sudoers file. This incident will be reported.
Now, as you can see, whenever I try to run 'sudo su postgres', I get asked to type in a password.
And when I run 'sudo -u postgres psql postgres', I get:
postgres@precise64:/vagrant/projects/microblog$ sudo -u postgres psql postgres postgres is not in the sudoers file. This incident will be reported.
I'm not sure what to do. I think dropping the vagrant user was key. Any help? Thanks!
Answers
Actually, never mind! I got past this. The problem was that I was trying to do things when I was in postgres@ and not in vagrant@; I had to type 'exit' to exit out of postgres@ first.