Running Postgresql on OSX

1

I'm trying to install Postgresql on OSX Lion. I'm using Homebrew, so my installation consisted of doing

brew install postgresql
initdb /usr/local/var/postgres

Now when I try to start postgresql using

postgres -D /usr/local/var/postgres

I get the following error:

postgres cannot access the server configuration file "/usr/local/var/postgres/postgresql.conf": No such file or directory

To try and figure out what is going wrong I ran 'brew doctor', which gives me one error which looks like it could be my issue (although I'm not 100% sure)

Error: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

archive
clusterdb
createdb
createlang
createuser
dropdb
droplang
dropuser
ecpg
pg_config
pg_dump
pg_dumpall
pg_restore
pg_upgrade
psql
reindexdb
vacuumdb

Consider amending your PATH so that /usr/local/bin is ahead of /usr/bin in your PATH.

I tried adding /usr/local/bin to my PATH variable by adding

PATH=/usr/local/bin:$PATH

as the first line of my .profile, but that didn't seem to make a difference.

Is this really why my postgresql is giving issues? How do I go about resolving this?

mjhasson

Posted 2012-05-08T12:28:09.373

Reputation: 11

Well, have you looked at the actual error message and checked whether the postgresql.conf file exists? By the way you need export PATH=… to properly store it. – slhck – 2012-05-08T12:29:06.987

No answers