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

From GF
Subject Re: Adding a pg_servername() function
Date
Msg-id CAFePLY3ZL9dt5xGj-1TCsa9VZn1Foz6=Fm_+R7CMXdz+DHo5LQ@mail.gmail.com
Whole thread Raw
In response to Re: Adding a pg_servername() function  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Adding a pg_servername() function
Re: Adding a pg_servername() function
List pgsql-hackers


On Wed, 9 Aug 2023 at 16:05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Peter Eisentraut <peter@eisentraut.org> writes:
> On 09.08.23 08:42, Laetitia Avrot wrote:
>> My question is very simple: Do you oppose having this feature in Postgres?

> I think this is pretty harmless(*) and can be useful, so it seems
> reasonable to pursue.

I actually do object to this, because I think the concept of "server
name" is extremely ill-defined

Tom,
But the gethostname() function is well defined, both in Linux and in Windows.
Maybe the proposed name pg_servername() is unfortunate in that it may suggest that DNS or something else is involved, but in Laetitia's patch the call is to gethostname().
Would it be less problematic if the function were called pg_gethostname()?
@Laetitia: why did you propose that name? maybe to avoid clashes with some extension out there?

Best,
Giovanni

pgsql-hackers by date:

Previous
From: "Tristan Partin"
Date:
Subject: Re: Fix last unitialized memory warning
Next
From: Peter Geoghegan
Date:
Subject: Re: pg15: reltuples stuck at -1 after pg_upgrade and VACUUM