Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to install a PostgreSQL instance after building it from source, but running the postmaster daemon prior to starting up the database cluster doesn't seem to work. Here's the error message I got when I started it up:

postgres@Home:~$ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
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

After googling around, the only result I could find which gave me some hints told me to run the following commands, the output of which follows:

postgres@Home:~$ lsof -i :5432
COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
postgres 1169 postgres    3u  IPv4   1998      0t0  TCP localhost:postgresql (LISTEN)

postgres@Home:~$ netstat -an|grep :5432
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN   

Which leads me to believe that the connection that the port that the postmaster daemon is trying to latch onto is, in fact, available. Any ideas on what might be causing it?

And if you're curious, I'm running pgsql 9.2.3. (Also, please move this to Stack Overflow or Programmers if this is the wrong Stack Exchange site to ask this at.)

share|improve this question
add comment

1 Answer 1

The error message at postmaster failed start and the netstat output show that there's already a process that uses the 5432 TCP port. Probably it's PostgreSQL already installed as part of your system. See if you have the postgresql-9.1 package installed, and the output of pg_lsclusters.

If you'd like to run your own self-compiled PostgreSQL side-by-side with the one pre-packaged for Ubuntu, it would be necessary to change the port configuration entry in your /usr/local/pgsql/data/postgresql.conf.

If on the other hand you want only your self-compiled PostgreSQL running and using the default port 5432, you may either remove the Ubuntu package or disable the cluster at boot by editing /etc/postgresql/9.1/main/start.conf

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.