PostgreSQL 8 - could not bind IPv4 socket

Issues related to software problems
Post Reply
GrzegorzBus
Posts: 1
Joined: 2009/04/30 11:59:37

PostgreSQL 8 - could not bind IPv4 socket

Post by GrzegorzBus » 2009/04/30 12:03:21

Hi,

I'm using Centos 4.7 and after upgrading PostgreSQL to version 8.3.7 (from ver. 7.4) via yum I cannot connect to my postgres server from remote hosts.

I know that for PostgreSQL servers starting with version 8.0 remote connections can only be set in postgresql.conf allowing them in “listen_addresses” parameter. My settings are following:

[code]listen_addresses = 'localhost,XXX.XXX.XXX.XXX'[/code]

where XXX.XXX.XXX.XXX is IP address of remote client that I want to be able to use PostgreSQL server. Port is default.

When I start server (service postgresql start) I receive status [OK], but in pgstartup.log there is information about some errors (or rather warnings – but that’s why remote connections don’t work):

[code]WARNING: could not create listen socket for "XXX.XXX.XXX.XXX"
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.[/code]

Of course – there is no other instance of PostgreSQL serve nor any other application is using this TCP port. This commands returns empty string:

[code]# netstat -plunt | grep 5432
# pg -A | grep postmaster[/code]

I must add that everything works fine for my local apps – they can easily connect to the server. I also tried few other non-default ports from range 60000+ with same result. Additionally, previous version (7.4) had no problems for accepting remote connections.

Thanks,
Grzegorz Bus

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

PostgreSQL 8 - could not bind IPv4 socket

Post by gerald_clark » 2009/04/30 13:07:37

I believe that listen address is the ip address of the interface on the server, not the client.

Post Reply

Return to “CentOS 4 - Software Support”