Luna is based on Ubuntu Precise.
First follow the steps here : https://wiki.postgresql.org/wiki/Apt
precise instead of
Then set a high priority preference for the new repository. I used 1000 because Elementary is 999 and
apt-get -t only goes to 900 which was not enough.
See : http://wiki.postgresql.org/wiki/Apt/FAQ#I_want_only_specific_packages_from_this_repository
apt-cache policy postgresql-common to make sure that the one from the new repository will be used instead of Elementary’s.
Finally, I had to modify
/etc/os-release because the Postgresql install script looks for Ubuntu or Debian, not Elementary. So
And it worked..!
To Postgresql packagers : please consider other ubuntu based distros (mint, elementary). It is now easier to install Postgresql on OSX than on Linux because the packages are not done correctly.