I wrote:
> The least thing it should do is error out if *no* TCP/IP port could
> be created while listen_addresses is set.
It's doing that now, and that should guard against the most common
problem, namemly the port already being occupied (since all TCP/IP
listen sockets use the same port).
Reading the comments in StreamServerPort, it seems the only problem we
can't go fatal error everywhere is that on some systems the IPv4 and
IPv6 sockets fight each other when bind() is called. For the other
failure modes, it seems that no such precautions are necessary. In
particular, I think we could error out in all of the following cases:
- Host or service name could not be resolved (just specify it
numerically instead). This would help against mistyped host names and
misconfigured name servers.
- MaxListen exceeded (don't configure so many sockets instead).
- socket() failed
- listen() failed
I think we could also error out if we cannot create at least one listen
socket for each entry in listen_addresses (instead of at least one
overall).
Comments on that?
--
Peter Eisentraut
http://developer.postgresql.org/~petere/