I got thi error when trying to run the ActiveRecord tests with the postgresql adapter in the vagrant box:
vagrant@rails-dev-box:/vagrant/rails/activerecord$ bundle exec rake test_postgresql
/vagrant/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:1466:in `initialize': FATAL: role "vagrant" does not exist (PG::Error)
The Contributing to Ruby on Rails guide recommends creating a PostgreSQL superuser with your shell user, and doing that fixes the issue.
add vagrant superuser to postgresql