How to get started?
Please visit GettingStarted Guide.
Fixing Postgres DB Installation (on Mac)
Q. I have a previously installed version of Postgres, which hasn't been installed correctly. And since that is listening on some port, I am unable to cleanly remove the installation and start from the beginning.
A. When you try removing Postgres, in there is a chance it will seem like it has worked successfully, until your latest installation throws an error saying that psql is still listening on some port, and server can therefore, not be started. This can be solved by removing all instances (if more than 1) of psql installed on your system (brew remove postgresql, and moving the application to trash), and ensuring that all existing (and therefore, listening) processes of psql are killed.
Following this, a reinstallation of postgreql should not cause any problems in setting up the database.