rails/rails — pull request #4810 by sskirby (2012-01-31 23:54:16+00:00)
Title: Fix usage of psql in db:test:prepare 

According to http://www.postgresql.org/docs/9.1/static/app-psql.html (which hasn't changed since at least version 7.0), the psql command line tool optionally takes a username as its last argument. However, the rake db:test:prepare task is mistakenly passing in the template database from database.yml.

This bug probably hasn't been discovered until now because it requires users to be using a sql schema dump (by using in application.rb: config.active_record.schema_format = :sql) AND to have specified a template in their database.yml.