3

I am getting this error with Postgresql 8.4 on Ubuntu Hardy:

$./postgres -D /usr/local/pgsql/data
LOG:  could not bind IPv4 socket: Cannot assign requested address
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

Here is my hosts file content (been finding a lot of stuff about this so just posting it now:

127.0.0.1 localhost
127.0.1.1 Home-Dev

Update: $ sudo netstat -tap | grep 5432 Came up blank.

I should also mention this is installed from source (I had original tried to install from the package and was getting the same error).

3 Answers 3

1
sudo /etc/init.d/postgres start

If you installed postgres via the package manager try that.

If it fails again, please post the contents of: sudo netstat -tap | grep 5432

1
  • It's actually /etc/init.d/postgresql-8.4. Dec 25, 2010 at 5:46
0

I had no loopback interface installed. When I installed it postgres started working.

0

Assuming that 127.0.1.1 is the IPv4 address of this machine that you are working on, I would like to point you to the following configuration files to look at: (the directory/pathnames may vary with relevance to your installation). You may find them in /etc/postgresql/8.4/main/ (found here in Ubuntu 10.04)

  • pg_hba.conf (/var/lib/pgsql/data/pg_hba.conf)
    • Comment out the other parameters and drop in the following
      • local all all trust
      • host all all 127.0.0.1/32 trust
      • host all all ::1/128 trust
      • host all all 127.0.1.1 255.255.255.255 trust
  • postgresql.conf (/var/lib/pgsql/data/postgresql.conf)
    • Ensure that the following parameter is pegged with a wildcard value
      • listen_address = '*'
    • Ensure that the following parameter is uncommented
      • port = 5432

You may want to amend/modify the values in the future once you have your PostgreSQL service up and running. :-) Hope this will be helpful.

You must log in to answer this question.