Re: fix psql \conninfo & \connect when using hostaddr

Поиск
Список
Период
Сортировка
Искать
От
Fabien COELHO
Тема
Re: fix psql \conninfo & \connect when using hostaddr
Дата
Msg-id
alpine.DEB.2.21.1906121430280.13288@lancre
Ответ на
Список
Дерево обсуждения
fix psql \conninfo & \connect when using hostaddr Fabien COELHO <coelho@cri.ensmp.fr>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Fabien COELHO <coelho@cri.ensmp.fr>
Re: fix psql \conninfo & \connect when using hostaddr Fabien COELHO <coelho@cri.ensmp.fr>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Fabien COELHO <coelho@cri.ensmp.fr>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Noah Misch <noah@leadboat.com>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Dmitry Dolgov <9erthalion6@gmail.com>
Re: fix psql \conninfo & \connect when using hostaddr Fabien COELHO <coelho@cri.ensmp.fr>
Re: fix psql \conninfo & \connect when using hostaddr Dmitry Dolgov <9erthalion6@gmail.com>
Re: fix psql \conninfo & \connect when using hostaddr Noah Misch <noah@leadboat.com>
Re: fix psql \conninfo & \connect when using hostaddr Fabien COELHO <coelho@cri.ensmp.fr>
Re: fix psql \conninfo & \connect when using hostaddr Fabien COELHO <coelho@cri.ensmp.fr>
Re: fix psql \conninfo & \connect when using hostaddr Noah Misch <noah@leadboat.com>
Re: fix psql \conninfo & \connect when using hostaddr Fabien COELHO <coelho@cri.ensmp.fr>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Michael Paquier <michael@paquier.xyz>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Noah Misch <noah@leadboat.com>
Re: fix psql \conninfo & \connect when using hostaddr Michael Paquier <michael@paquier.xyz>
Re: fix psql \conninfo & \connect when using hostaddr Dmitry Dolgov <9erthalion6@gmail.com>
Re: fix psql \conninfo & \connect when using hostaddr Fabien COELHO <coelho@cri.ensmp.fr>
Re: fix psql \conninfo & \connect when using hostaddr Robert Haas <robertmhaas@gmail.com>
Re: fix psql \conninfo & \connect when using hostaddr Fabien COELHO <coelho@cri.ensmp.fr>
Re: fix psql \conninfo & \connect when using hostaddr Pavel Stehule <pavel.stehule@gmail.com>
Re: fix psql \conninfo & \connect when using hostaddr Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: fix psql \conninfo & \connect when using hostaddr Pavel Stehule <pavel.stehule@gmail.com>
Re: fix psql \conninfo & \connect when using hostaddr Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Tom Lane <tgl@sss.pgh.pa.us>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Michael Paquier <michael@paquier.xyz>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Fabien COELHO <coelho@cri.ensmp.fr>
Re: fix psql \conninfo & \connect when using hostaddr Alvaro Herrera <alvherre@2ndquadrant.com>
Re: fix psql \conninfo & \connect when using hostaddr Fabien COELHO <fabien.coelho@mines-paristech.fr>

Hello,

> I got that. I'm working on it, and on the other issues you raised.
>
> The issue I see is what do we want when a name resolves to multiple 
> addresses. The answer is not fully obvious to me right now. I'll try to send 
> a patch over the week-end.

At Alvaro's request, here is a quick WIP patch, that does not do the right 
thing, because there is no simple way to know whether hostaddr was set at 
the libPQ level, so either we set it always, about which Noah complained, 
or we don't, about which someone else will complain quite easily, i.e. 
with this patch

   \c "host=foo hostaddr=ip"

connects to ip, but then

   \c

will reconnect to foo but ignore ip. Well, ISTM that this is back to the 
previous doubtful behavior, so at least it is not a regression, just the 
same bug:-)

A solution could be to have a PQdoestheconnectionuseshostaddr(conn) 
function, but I cannot say I'd be thrilled.

Another option would be to import PGconn full definition in 
"psql/command.c", but that would break the PQ interface, I cannot say I'd 
be thrilled either.

The patch returns host as defined by the user, but the regenerated 
hostaddr (aka connip), which is not an homogeneous behavior. PQhost should 
probably use connip if host was set as an ip, but that needs guessing.

The underlying issue is that the host/hostaddr stuff is not that easy to 
fix.

At least, after the patch the connection information (\conninfo) is still 
the right one, which is an improvement.

-- 
Fabien.
В списке pgsql-hackers по дате отправления
От: Kuntal Ghosh
Дата:
От: tushar
Дата:
FAQ