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).
Best Answer
If you installed postgres via the package manager try that.
If it fails again, please post the contents of: sudo netstat -tap | grep 5432