http://www.amazon.com/Deploy-Rails-BlueBook-2014-Edition-ebo...
https://github.com/jbwyatt4/railsbluebook2014/blob/master/co...
Just remember to login as the postgres user in Linux.
If you're having issues with using postgresql with Rails and heroku (judging from post below), then you're really asking how use those three things together. In this case there are plenty of examples of all the things that can go wrong and how to fix them on stack overflow. If you'd like to send me the errors you're getting and other details of why it's breaking I'd be glad to field a couple emails (contact in profile).
Are you an experienced database administrator looking at postgreSQL for a new project?
Are you an experienced programmer, coming to postgreSQL as an option for your first project with three tiered architecture?
Are you new to programming and want to learn to database?
Are you new to databases and expect them to be pretty much like word processors and spreadsheets?
Yes... and the OP was very unspecific as to what exactly was the problem. Maybe he/she just doesn't get SQL, I don't know. If the question was PostgreSQL specific, then that is another issue.