Here is my quick-and-dirty recipe for how to make the switch a Heroku app from MySQL to Postgresql with minimal downtime.
It is not difficult to set up a Rails app with MySQL on Heroku if you know what to do, but there are a surprising number of “gotchas” that are not well documented.