How do I install a specific version of a formula in homebrew? For example, postgresql-8.4.4 instead of the latest 9.0.
On the newest version of homebrew (0.9.5 as of this writing) there will be a specific recipe for the version of the homebrew keg you want to install. Example:
$ brew search mongodb
mongodb mongodb24 mongodb26
Then just do brew install mongodb26 like normal.
In the case that you had already installed the latest version, make sure to unlink the latest version and link the desired version: brew unlink mongodb && brew link mongodb26.