Re: LibPQ doesn't say host=* translates to localhost

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: LibPQ doesn't say host=* translates to localhost
Дата
Msg-id CAKFQuwZrnhgQHRa_ArB-kBgrXV+w=ovfR_F4FEamgc-asu0j8g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: LibPQ doesn't say host=* translates to localhost  (Francisco Olarte <folarte@peoplecall.com>)
Ответы Re: LibPQ doesn't say host=* translates to localhost  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Fri, Jun 28, 2024 at 12:48 AM Francisco Olarte <folarte@peoplecall.com> wrote:
On Thu, 27 Jun 2024 at 21:57, David G. Johnston
<david.g.johnston@gmail.com> wrote:
> The documentation [0] doesn't say this should work and general networking knowledge leads me to believe it wouldn't [1].
>
> PGHOST='*' psql postgres
> psql (17beta1)
> SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: postgresql)
> Type "help" for help.
>
> postgres=# \conninfo
> You are connected to database "postgres" as user "davidj" on host "*" (address "127.0.0.1") at port "5432".
> SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: postgresql)
>
> David J.
>
> [0] https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
>
> [1]
> ping *
> ping: src: Temporary failure in name resolution

Bad quoting, PGHOST=¡*', single quoted, but ping *, unquouted, with an
error message which hints at <<echo ping *>> giving back <<ping src
....>>

Bug may be real, but ping '*' could give some better data for debugging.


Good catch.

ping '*'
ping: *: Name or service not known

This is Ubuntu.

I'm fine with not documenting this if we are delegating to some underlying library that makes the behavior platform-specific (though maybe document that...even though it now seems obvious to me in retrospect).  I just thought since ping didn't work we were doing something in between to avoid the issue.

David J.

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert
Следующее
От: Tom Lane
Дата:
Сообщение: Re: LibPQ doesn't say host=* translates to localhost