Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
postgres 1169 postgres    3u  IPv4   1998      0t0  TCP localhost:postgresql (LISTEN)

postgres@Home:~$ netstat -an|grep :5432
tcp        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

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

Your Answer


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.