Postgres does not know where to find the server configuration

I am trying to run PostgreSQL for RoR on my new mac (I'm a newbie). I followed the installation guide, but I cannot get it to work correctly. I found similar questions, but that didn't help. I get the following error on cmd in 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. 

however, when I set my -D call through

 postgres -D /usr/local/var/postgres 

I get another error

 FATAL: lock file "postmaster.pid" already exists HINT: Is another postmaster (PID 6621) running in data directory "/usr/local/var/postgres"? 

I tried to use "kill 6621", but then it just ran another postmaster on a different PID. I also tried removing the PID and running

 postgres -D /usr/local/var/postgres 

I get the following errors:

 LOG: could not bind IPv6 socket: Address already in use HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. LOG: could not bind IPv4 socket: Address already in use HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. WARNING: could not create listen socket for "localhost" FATAL: could not create any TCP/IP sockets 

Does anyone know what I'm doing wrong?

+7
postgresql
source share
1 answer

Usually, when postgres is installed, a service / daemon is created on the system, so there is no need to start the server manually. You receive an error message because the service is already running.

Try connecting to the database using psql

+5
source share

All Articles