From: | Pratik Pandit <pratikpandit5322(at)gmail(dot)com> |
---|---|
To: | Stelios Malathouras <s(dot)malathouras(at)deltasoftsolutions(dot)net> |
Cc: | "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Does PostgreSQL listen_addresses='*' Dynamically Detect New Interfaces |
Date: | 2025-05-05 11:19:39 |
Message-ID: | CAFchsDXPDTf_4FQi2Q2sfrQ-E=uoT4Xz5wYZZ7jJmjCK61uSMw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Hi Stelios,
Yes, this behavior is typical for PostgreSQL when listen_addresses is set
to '*'. When PostgreSQL is configured to listen on all available network
interfaces (via listen_addresses = '*'), it dynamically detects new
interfaces and IP addresses without requiring a restart or service reload.
So, as long as listen_addresses is '*' and the necessary network interfaces
are configured correctly in the OS, PostgreSQL should continue functioning
as expected without requiring a restart.
Why it is safe (under normal conditions) : -
1.
OS handles the interfaces: PostgreSQL trusts the OS to expose valid
network interfaces. If the OS assigns a new IP, PostgreSQL bound to '*'
can accept connections immediately — no corruption or instability risks.
2.
No restart required: As you observed, PostgreSQL doesn't need to rebind
or restart because it's already listening on the wildcard interface (
0.0.0.0 or :: for IPv6).
3.
Used in production setups: Many production systems with HA setups (e.g.,
floating IPs or VIPs) rely on this behavior during failover
Thanks,
Pratik Pandit
On Mon, May 5, 2025 at 2:26 PM Stelios Malathouras <
s(dot)malathouras(at)deltasoftsolutions(dot)net> wrote:
> Hi,
>
> We've scheduled for an IP change for one of our dedicated PostgreSQL
> servers, running on version 13.8.
> Our local tests, with listen_addresses = '*', show that the postgres
> listener accepts connections immediately to the new IP.
> The same behavior is observed when adding a new network interface.
> Postgres accepts connections to the new network interface (and IP)
> immediately without requiring a restart.
>
> Is it safe to assume this is the default behaviour ? How does the
> instance detect new interfaces and their IP(s) and begin listening on them
> without needing a service reload or restart?
>
> Thanks,
>
> *Stelios*
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2025-05-05 14:31:24 | Re: Does PostgreSQL listen_addresses='*' Dynamically Detect New Interfaces |
Previous Message | Stelios Malathouras | 2025-05-05 08:26:38 | Does PostgreSQL listen_addresses='*' Dynamically Detect New Interfaces |