title: ActiveRecord::StatementInvalid: PG::Error: ERROR: must be owner of database
body: <p>I'm new to rails , Some errors occurred when I tried to run <code>bundle exec rake test:prepare</code> , 
  Same question had been asked <a href="https://stackoverflow.com/questions/7210563/rake-aborted-error-must-be-owner-of-database">Click here</a> ,I have included  the psql output. Anyone can help? Thank you. </p>
  
  <p>I got flowing  errors : </p>
  
  <pre><code>rake aborted!
  ActiveRecord::StatementInvalid: PG::Error: ERROR:  must be owner of database testp00
  : DROP DATABASE IF EXISTS "testp00"
  /Users/snailwalker/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `exec'
  /Users/snailwalker/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
  /Users/snailwalker/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:435:in `block in log'
  /Users/snailwalker/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-(required)&gt;'
  /Users/snailwalker/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.0.2/lib/active_record/railties/databases.rake:370:in `block (3 levels) in &lt;top (required)&gt;'
  Tasks: TOP =&gt; db:test:load =&gt; db:test:purge
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>psql :</p>
  
  <pre><code>   snailwalker=# \l
                                       List of databases
         Name        |    Owner    | Encoding | Collate | Ctype |      Access privileges      
  -------------------+-------------+----------+---------+-------+-----------------------------
   devep00           | snailwalker | UTF8     | C       | UTF-8 | 
   myapp_development | snailwalker | UTF8     | C       | UTF-8 | 
   myapp_test        | snailwalker | UTF8     | C       | UTF-8 | 
   postgres          | snailwalker | UTF8     | C       | UTF-8 | 
   snailwalker       | snailwalker | UTF8     | C       | UTF-8 | 
   template0         | snailwalker | UTF8     | C       | UTF-8 | =c/snailwalker             +
                     |             |          |         |       | snailwalker=CTc/snailwalker
   template1         | snailwalker | UTF8     | C       | UTF-8 | =c/snailwalker             +
                     |             |          |         |       | snailwalker=CTc/snailwalker
   testp00           | snailwalker | UTF8     | C       | UTF-8 | 
  (8 rows)
  </code></pre>
  
  <p>databse.yml:</p>
  
  <pre><code>  development:
    adapter: postgresql
    encoding: unicode
    database: devep00
    pool: 5
    username: taouan
    password:
  
  test:
    adapter: postgresql
    encoding: unicode
    database: testp00
    pool: 5
    username: taouan
    password:
  </code></pre>