14

I want to use the pre-installed postgresql on my local machine (mac os 10.7.5), when I run which psql I find it (in /usr/bin/psql), but then running

pg_ctl -D /usr/bin/psql -l /usr/bin/psql/server.log start

results in:

-bash: pg_ctl: command not found

How can I start/use my postgresql database? do I need to install it (with say Homebrew) or can I use the pre-installed one on my mac? I also tried using the initdb command (initdb /usr/bin/psql -E utf8) and also go tthe same message: -bash: initdb: command not found.

Also, is this psql the same as postgres? (I tried which postgres and got nothing)

Update: I'm using psql commands in the command line, but am getting there the following message (for psql -l and psql -a for instance):

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
Lucy Weatherford
  • 5,452
  • 16
  • 50
  • 76

1 Answers1

6

OS X ships with the command line client (for interacting with postgres databases) not the server.

You need to install the server.

Check the postgres site or grab the postgres.app

Chris Farmiloe
  • 13,935
  • 5
  • 48
  • 57
  • 3
    Thank you, I tried postgerapp now, and updated the path in the `.zshrc` file, but am still getting the same error: `psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?` – Lucy Weatherford Apr 20 '13 at 11:54
  • I ended up using homebrew to install postgres itself – Lucy Weatherford Apr 20 '13 at 19:25