I was trying to install Postgres several times, but it didn't work out. I am using Mac and I tried to install Postgress.app, I got problems with database connection. I decided to install Postgress using HomeBrew.
At the beginning, I uninstalled all the versions:
Using brew remove --force postgresql
to remove all versions
I used brew cleanup posgtres as well
Then, launched the installation using home brew
> ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/postgresql-
> Already downloaded:
> /Library/Caches/Homebrew/postgresql-9.3.2.mountain_lion.bottle.tar.gz
> ==> Pouring postgresql-9.3.2.mountain_lion.bottle.tar.gz
> ==> Caveats If builds of PostgreSQL 9 are failing and you have version 8.x installed, you may need to remove the previous version first. See: https://github.com/Homebrew/homebrew/issues/issue/2510
>
> To migrate existing data from a previous major version (pre-9.3) of
> PostgreSQL, see:
> http://www.postgresql.org/docs/9.3/static/upgrading.html
>
> When installing the postgres gem, including ARCHFLAGS is recommended:
> ARCHFLAGS="-arch x86_64" gem install pg
>
> To install gems without sudo, see the Homebrew wiki.
>
> To reload postgresql after an upgrade:
> launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
> launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Any recommendation to install Postgres right way on my machine.