How to set up a PostgresSQL server on MacOS 10.8.5?

I am trying to connect to my postgres server from the command line:

    $> psql
    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"?

And I'm trying to start the server:

    $>postgres
    postgres does not know where to find the server configuration file.
    You must specify the --config-file or -D invocation option or set the 
    PGDATA environment variable.

Can someone tell me how can I configure my server so that it works?

+1
source share
1 answer

I solved this problem. In fact, Mac OS 10.8.5 has its own psql command. So this is the way to go. If you install postgres from MacPort, the system will always reference the initial psql command.

I advise you to install postgres from brew, as shown here .

You will also override the PATH environment variable and export it to the .profile file:

export PATH=/usr/local/bin:$PATH
0
source

All Articles