title: Postgres No permission to create user
body: <p>I am unable to use rails with postgres. The database wont create:</p>
  
  <pre><code>sayth@sayth-TravelMate-5740G:~/testapp2$ rake db:create:all
  PG::InsufficientPrivilege: ERROR:  permission denied to create database
  : CREATE DATABASE "testapp2_development" ENCODING = 'unicode'
  ....
  Couldn't create database for {"adapter"=&gt;"postgresql", "encoding"=&gt;"unicode", "database"=&gt;"testapp2_production", "pool"=&gt;5, "username"=&gt;"testapp2", "password"=&gt;nil}
  </code></pre>
  
  <p>So I am following the solution here <a href="https://stackoverflow.com/a/8639649">https://stackoverflow.com/a/8639649</a></p>
  
  <p>These are the steps i am having issue with.</p>
  
  <pre><code>$ psql -d postgres
  postgres=# create role app_name login createdb;
  postgres=# \q
  </code></pre>
  
  <p>However when I am in the psql shell to give the create role with createdb ability it fails auth.</p>
  
  <pre><code>sayth@sayth-TravelMate-5740G:~/testapp2$ psql -d postgres
  psql (9.2.4)
  Type "help" for help.
  
  postgres=&gt; create role sayth createdb;
  ERROR:  permission denied to create role
  postgres=&gt; 
  </code></pre>
  
  <p>How then do I create the auth?</p>
  
  <p>Edit Update 
  Reviewing <a href="http://www.postgresql.org/docs/9.2/static/tutorial-createdb.html" rel="nofollow noreferrer">http://www.postgresql.org/docs/9.2/static/tutorial-createdb.html</a>
  And <a href="http://www.postgresql.org/docs/9.2/static/database-roles.html" rel="nofollow noreferrer">http://www.postgresql.org/docs/9.2/static/database-roles.html</a></p>
  
  <p>But cannot use root to create accounts as it doesn't exist and I need to be root to create it.</p>
  
  <pre><code>sayth@sayth-TravelMate-5740G:~$ sudo psql -d postgres
  [sudo] password for sayth: 
  Sorry, try again.
  [sudo] password for sayth: 
  psql: FATAL:  role "root" does not exist
  </code></pre>