Re: Adding a pg_servername() function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Adding a pg_servername() function
Дата
Msg-id 110309.1691598695@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Adding a pg_servername() function  (GF <phabriz@gmail.com>)
Ответы Re: Adding a pg_servername() function
Список pgsql-hackers
GF <phabriz@gmail.com> writes:
> On Wed, 9 Aug 2023 at 16:05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I actually do object to this, because I think the concept of "server
>> name" is extremely ill-defined

> But the gethostname() function is well defined, both in Linux and in
> Windows.

Sure, its call convention is standardized.  But I see nothing in POSIX
saying whether it returns a FQDN or just some random name.  In any
case, the bigger issue is that I don't really want us to expose a
function defined as "whatever gethostname() says".  I think there will
be portability issues on some platforms, and I am dubious that that
definition is what people would want.

One concrete reason why I am doubtful about this is the case of
multiple PG servers running on the same machine.  gethostname()
will be unable to distinguish them.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Using defines for protocol characters
Следующее
От: Dmitry Dolgov
Дата:
Сообщение: Re: [RFC] Clang plugin for catching suspicious typedef casting