1

I've had no luck in starting the postgres server. I can add new databases, tables, etc to the postgres from the terminal, but can't add things to the tables through a webpage. The webpage is running on a localhost for now.

The postgres data folder was originally created in a root user, but I moved it to my own user account and it solved many problems, but I'm back at the same old error I keep getting after entering postgres -D data (data being the data cluster folder)

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

I tried two different commands to start the server.

pg_ctl -D data -l logfile start 

which gave me this, but it's not correct

server starting

and

pg_ctl -D /Library/PostgreSQL/9.4/data -l log file start

which gave me this

LOG:  skipping missing configuration file "/Library/PostgreSQL/9.4/data/postgresql.auto.conf"
pg_ctl: another server might be running; trying to start server anyway
server starting

The postgresql.auto.conf file is most definitely there with correct name and everything. If I try to stop the supposedly started server it results in this with the first one from the first command I tried and the second stop with the second command.

Is server running?

and

LOG:  skipping missing configuration file "/Library/PostgreSQL/9.4/data/postgresql.auto.conf"
pg_ctl: could not send stop signal (PID: 83): Operation not permitted

2 Answers 2

1

Something seems to already use port 5432.

Try to find out, which program (maybe another instance of postgres) is blocking that port and decide whether to stop that other process, or not.

As an alternative reconfigure postgres to use other ports.

Maybe you can find out, what is blocking that port by typing this into the console:

lsof -n -i4TCP:5432 | grep LISTEN
Sign up to request clarification or add additional context in comments.

1 Comment

Postgres is indeed already running on port 5432. I wonder why when I try pg_ctl -D /Library/PostgreSQL/9.4/data status is says no server running
0

Its clear that there is another instance of postgres running. You have to stop that one before starting yours manually as this will go in conflict with the port numbers.

sudo launchctl stop com.edb.launchd.postgresql-9.4

The try and launch with your command.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.