Re: libpq host/hostaddr/conninfo inconsistencies

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: libpq host/hostaddr/conninfo inconsistencies
Дата
Msg-id 22232.1550764539@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: libpq host/hostaddr/conninfo inconsistencies  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: libpq host/hostaddr/conninfo inconsistencies  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
Fabien COELHO <coelho@cri.ensmp.fr> writes:
> However, it does not discuss that an IP can (and should, IMHO) be given 
> through "host" if the point is to specify the target by its IP rather than 
> a lookup shortcut.

Ah, that's the crux of the problem.  There are two ways that you could
consider to be "best practice" for use of these parameters.  The one
that is currently documented is:

1. If you want to give a host name, put it in "host".
2. If you want to give a host IP address (to skip DNS), put it in
   "hostaddr".
3. ... unless your security arrangements require specifying a host name,
   in which case provide the host IP address in "hostaddr" and
   the host name in "host".

What Fabien is basically proposing is replacing rule 2 with

2. If you want to give a host IP address (to skip DNS), put it in
   "host".

While that would perhaps be an equally good best practice if we'd
started there, it's not clear to me that it has any advantage that
would justify changing the recommendation.  In particular, the
existing rule is a lot clearer from a data-type standpoint: host
is for names, hostaddr is for IP addresses.

In any case, the existing doco never comes out and states either
rule set in so many words.  Maybe it should.

            regards, tom lane


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: libpq host/hostaddr/conninfo inconsistencies
Следующее
От: Tom Lane
Дата:
Сообщение: Re: libpq host/hostaddr/conninfo inconsistencies