2

Need help after scouting all those issues with postgres and mac 10.8

I installed pg through homebrew (tried with heroku app also but no luck)

which psql --> /usr/local/bin/psql
psql --version --> psql (PostgreSQL) 9.2.4

When starting rails server I get Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

When I do pg_ctl -D /usr/local/var/postgres -l logfile start I get server starting

When I run psql I get Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Any idea?

olimart
  • 1,529
  • 3
  • 17
  • 32
  • Can you check `/usr/local/var/postgres/server.log` or `/usr/local/var/postgres/*.log` for errors? – jallen7usa Aug 28 '13 at 20:12
  • Can you check if the service is running? `ps aux | grep postgres` in linux – usha Aug 28 '13 at 20:13
  • http://stackoverflow.com/a/8482546/905902 possible duplicate – wildplasser Aug 28 '13 at 21:04
  • what does `which postgres` return and then what does `ls -l PATH_TO_POSTGRES` show - its possible it will still point to the factory installed version of postgres that comes with mac 10.8 – house9 Aug 28 '13 at 22:02
  • @jallen7usa `/usr/local/var/postgres/server.log` does not exist because `/usr/local/var/postgres/` does not exist. @Vimsha looks like it's running since I get `username 16523 0,0 0,0 2432768 460 s000 R+ 9:28 0:00.00 grep postgres` – olimart Aug 29 '13 at 13:29
  • @house9 `which postgres` returns `/usr/local/bin/postgres` which postgres. `ls -l /usr/local/bin/postgres lrwxr-xr-x 1 olivier admin 39 28 aoû 15:57 /usr/local/bin/postgres -> ../Cellar/postgresql/9.2.4/bin/postgres` @Vimsha looks like it's running since I get `username 16523 0,0 0,0 2432768 460 s000 R+ 9:28 0:00.00 grep postgres` @jallen7usa `/usr/local/var/postgres/server.log` does not exist because `/usr/local/var/postgres/` does not exist – olimart Aug 29 '13 at 13:36
  • @olivier hmm perhaps your defaults are different. If you used the default plist to start your instance you can check there. Something like (but probably not exactly) this should show you the paths you're using: `cat /usr/local/Cellar/postgresql/9.2.4/homebrew.mxcl.postgresql.plist` – jallen7usa Aug 29 '13 at 17:29

2 Answers2

6

Whatever is wrong with my setup I ended adding host: localhostto my database.ymland it did the trick. Too much time wasted so it will remain as is for now. Thanks for your help.

olimart
  • 1,529
  • 3
  • 17
  • 32
0

Do you have the user "postgres" in the system?

I don't know homebrew but maybe you need:

/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

Also postgres user must have write permissions on logs files.

aarkerio
  • 2,183
  • 2
  • 20
  • 34