One of our project is running on old Postgresql version 8, so I decided to install the old version on my machine using homebrew (yeah, my favorite tool).
Likewise, before install any new software, I run the following tasks:
Now, if you do 'brew info postgresql', you'll get the latest stable version that is 9.3.5 (at the time of this post). But this is not the one I want, right.
It turns out that you can look for other postgresql softwares using this command:
and returns the following result:
postgresql postgresql8 postgresql9 postgresql91 postgresql92
Ok, now I see the version 8, so instead just type-in 'postgresql', you need to specify 'postgresql8' and it will install the latest update for version 8:
To switch to version 8, i type in:
brew switch postgresql8 8.4.21
Remember to check your local postgresql8 version first, by executing:
Also, you might need to update existing links for postgresql:
brew link --overwrite postgresql8
and not to forget to create new database. Since the current one is for postgresql ver9, creating new one called postgresql8 like so:
initdb /usr/local/var/postgres8
and start postgresql ver8
pg_ctl -D /usr/local/var/postgres8 -l logfile start