Re: Adding a pg_servername() function - Mailing list pgsql-hackers

From Laetitia Avrot
Subject Re: Adding a pg_servername() function
Date
Msg-id CAB_COdi3eATKUo+-FBzwpe8TV_RpUsx_Xy6yxkJawU6wHT5dag@mail.gmail.com
Whole thread Raw
In response to Re: Adding a pg_servername() function  (066ce286@free.fr)
List pgsql-hackers


Le jeu. 3 août 2023 à 14:20, <066ce286@free.fr> a écrit :


> Agreed, depending on how hosts and dns are set, it can be useless.
> But normally, companies have host making standards to avoid that.


BTW you already have it :

select setting from pg_settings where name = 'listen_addresses'

No ?


Hello,

No, this is not the same thing. Most of the time, we will find either the wildcard '*' or an Ip address or a list of IP addresses, which is not what we want in this particular use case. But I agree that there are some use cases where we will find the hostname there, but from my experience, that's not the majority of the use cases.

For example, you could use a VIP in listen_addresses, so that you ensure that distant connection will go through that VIP and you'll always end up on the right server even though it might be another physical instance (after switch or failover).

Lætitia
 

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Use of additional index columns in rows filtering
Next
From: Andy Fan
Date:
Subject: Re: Extract numeric filed in JSONB more effectively