Postgresql - start with mac - `pg_ctl` does not work

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

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

leads to:

 -bash: pg_ctl: command not found 

How can I run / use my postgresql database? Do I need to install it (for example, using Homebrew), or can I use the pre-installed on my Mac? I also tried using the initdb command ( initdb /usr/bin/psql -E utf8 ) and also go to the same message: -bash: initdb: command not found .

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

Update: I use psql commands on the command line, but I get the following message (e.g. for psql -l and psql -a ):

 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"? 
+6
source share
1 answer

OS X comes with a command line client (for interacting with postgres databases), not a server.

You need to install the server.

Check the postgres website or get postgres.app

+5
source

All Articles