title: Can't use postgres user in new database for rails 3 on ubuntu 10.04 server
body: <p>I'm trying to get a rails 3 app up and running on an ubuntu 10.04.  It's my first postgres project and i'm struggling to get postgres working properly.  It's all installed, and i can get into it with <code>psql</code>.  </p>
  
  <p>I followed the instructions <a href="https://help.ubuntu.com/community/PostgreSQL" rel="nofollow">here</a> to set the password for the postgres user called 'postgres':  </p>
  
  <pre><code>#on the command line
  sudo -u postgres psql postgres
  
  #in postgres
  \password postgres
  \quit
  </code></pre>
  
  <p>I <em>thought</em> that this would set the password for the postgres user to 'postgres'.  But, now i can't log in as the postgres user.</p>
  
  <p>My db config looks like this:</p>
  
  <pre><code>development:
    adapter: postgresql
    database: chronicle_development
    username: postgres
    password: postgres
    pool: 5
    timeout: 5000
  
  test:
    adapter: postgresql
    database: chronicle_test
    username: postgres
    password: postgres
    pool: 5
    timeout: 5000
  
  production:
    adapter: postgresql
    database: chronicle_production
    username: postgres
    password: postgres
    pool: 5
    timeout: 5000
  </code></pre>
  
  <p>I thought this would be fine - i've changed (postgres user) postgres's password to 'postgres' and this is in my config.  But, when i do <code>rake db:migrate</code> i get</p>
  
  <pre><code>rake aborted!
  FATAL:  Ident authentication failed for user "postgres"
  </code></pre>
  
  <p>Ok...maybe you can't specify the password in the db config like that?  So, i made a ~/.pgpass file which has this:</p>
  
  <pre><code>*:*:*:postgres:postgres
  </code></pre>
  
  <p>Still get the same error message.  </p>
  
  <p>I've made another user called 'max' who can get in ok, but the config file (with postgres) works for the other guys on the project so i need to get mine working with that config file.  Is it possible to remove the password from the postgres account?  Or fix this some other way?  thanks, max</p>
  
  <p>EDIT - just tried something else, which didn't work unfortunately.  I read on <a href="http://www.postgresql.org/docs/8.4/static/sql-alterrole.html" rel="nofollow">this page</a> that renaming a role clears its password, so gave it a go.</p>
  
  <pre><code>#in psql
  =# alter role postgres rename to postgres2;
  NOTICE:  MD5 password cleared because of role rename
  </code></pre>
  
  <p>This sounded encouraging! So, i changed it back to postgres again.  But still no luck.  It also didn't work when i left the user as <code>postgres2</code> and changed my config to have that username - i got <code>FATAL:  Ident authentication failed for user "postgres2"</code>.  Why does it work for max but not for postgres/postgres2?  Is it to do with users in my ubuntu env?  my username in linux is also 'max'.</p>