Mutable listen_addresses GUC

Started by Ivan Kovmir7 months ago2 messageshackers
Jump to latest
#1Ivan Kovmir
ivan.kovmir@cybertec.at

Hello.

It is necessary to restart PostgreSQL to bind to a different network
interface, thus breaking the active connections. This patch draft
makes it no longer necessary, just assign the new value to
`listen_addresses` GUC and send SIGHUP to Postmaster.

Do you think it is useful? Is there any chance to push it upstream?
Overall thoughts?

Attachments:

0001-Change-bound-network-interfaces-without-restart.patchtext/x-patch; charset=US-ASCII; name=0001-Change-bound-network-interfaces-without-restart.patchDownload+191-2
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ivan Kovmir (#1)
Re: Mutable listen_addresses GUC

Ivan Kovmir <ivan.kovmir@cybertec.at> writes:

It is necessary to restart PostgreSQL to bind to a different network
interface, thus breaking the active connections.

On most platforms, if you set listen_addresses to "*" then there's no
problem, the kernel will automatically cope with IP address changes.
Do we really need more than that?

The reason I'm pushing back is that this patch looks extremely
complicated and hard-to-test. It also violates one of the fundamental
precepts of the GUC subsystem, namely that assign hooks shalt not
fail. And there is a lot of stuff you've not covered, such as the
logic around whether to register for Bonjour. We could possibly
make this feature work, but the cost-benefit ratio looks quite poor.

regards, tom lane