title: FATAL: database "postgres" does not exist
body: <p>Weird error. All help appreciated. </p>
  
  <p>Here's my database.yml</p>
  
  <pre><code>development:
    adapter: postgresql
    encoding: unicode
    database: app_development
    pool: 5
    username: username
    password:
  
  test:
    adapter: postgresql
    encoding: unicode
    database: app_test
    pool: 5
    username: username
    password:
  
  production:
    adapter: postgresql
    encoding: unicode
    database: app_production
    pool: 5
    username: username
    password:
  </code></pre>
  
  <p>When I create the databases manually and try to use them, for example <code>rake db:test:preare</code> I get the following error:</p>
  
  <pre><code>FATAL:  database "postgres" does not exist
  </code></pre>
  
  <p>When I try to drop the databases I get the following errors:</p>
  
  <pre><code>Couldn't drop app_development : #&lt;PG::Error: FATAL:  database "postgres" does not exist
  &gt;
  Couldn't drop app_test : #&lt;PG::Error: FATAL:  database "postgres" does not exist
  &gt;
  Couldn't drop app_production : #&lt;PG::Error: FATAL:  database "postgres" does not exist
  </code></pre>
  
  <p>If I try to create the databases through with <code>rake db:create:all</code> I get the following errors:</p>
  
  <pre><code>app_development already exists
  app_test already exists
  app_production already exists
  </code></pre>
  
  <p>So it appears that my database.yml is ok. But for some reason it's looking for a database called postgres when that's not what's in my database.yml.</p>
  
  <p>Any help appreciated.</p>
  
  <p>EDIT: </p>
  
  <p>Here is more from the trace of rake:</p>
  
  <p>Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"app_production", "pool"=>5, "username"=>"username", "password"=>nil}</p>