Re: libpq host/hostaddr/conninfo inconsistencies

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: libpq host/hostaddr/conninfo inconsistencies
Date: 2019-02-21 15:18:16
Message-ID: alpine.DEB.2.21.1902211527260.27203@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Tom,

> My only complaint about this is that it makes it sound like you *must*
> provide "host", even when giving "hostaddr":

That is the idea, "hostaddr" is moslty never needed.

It is the initial misleading issue I've been complaining about: one can
specify an IP *both* in host (although it is not documented) and in
hostaddr... and when both are provided, things started being messy: the
information displayed was plain wrong (eg telling you that you were
connected to an IP when you were really connected to another), and one
could not get the actual information about the current connection out of
libpq.

A committed patch has fixed the display (\conninfo) and connection
(\c) issues by extending libpq and being carefull about the message
displayed or the information used to reconnect, which were basically bug
fixes.

About host/hostaddr, my initial submission was to force "host" as the
target (whether name, directory, or ip which already work) and "hostaddr"
only as a lookup shortcut, which is I think its initial intended use. This
has been rejected.

Now I'm just trying to improve the documentation so that at least it
reflects what is done, and implicitely advise about how to use the
features properly even if it is not enforced: Basically, a user should
always used "host" for all purposes because it works, and that makes one
parameter for one purpose, and "hostaddr" is only needed for lookup
shortcut, which is basically a very rare and specialized use case.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2019-02-21 15:27:06 Re: Journal based VACUUM FULL
Previous Message MikalaiKeida 2019-02-21 15:01:26 RE: Timeout parameters