I am having trouble getting postgresql getting set up on Mac OSX Lion. I used brew to install postgres, but there is also a default installed postgres on Lion so I don’t know if that is the problem. Here is my attempt to start the server, which appears to work but then I can’t access psql. I also created a user called “postgres” but I am not sure what exactly to do with it.
Superfly:~ James$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting
Superfly:~ James$ ps aux | grep postgres
postgres 18990 0.0 0.0 2435492 1044 s000 S 7:52PM 0:00.01 bash
root 18989 0.0 0.0 2446896 1848 s000 S 7:52PM 0:00.02 su postgres
James 19310 0.0 0.0 2434892 544 s001 S+ 8:16PM 0:00.00 grep postgres
Superfly:~ James$ psql -U postgres
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Here is where pg_ctl and psql are installed on my computer.
Superfly:~ James$ which psql
/usr/local/bin/psql
Superfly:~ James$ which pg_ctl
/usr/local/bin/pg_ctl
Any help would be appreciated.
Which user did you run that as?
Brewgives instructions after you install, did you run those commands? You need to run thepg_ctlaspostgresuser. I don’t know why you didn’t get error messages but you need to give the data directory.