On Fri, Oct 26, 2018 at 9:54 AM Fabien COELHO <coe...@cri.ensmp.fr> wrote:
> About updating psql's behavior, without this patch:
>
>    sh> psql "host=foo hostaddr=127.0.0.1"
>
>    psql> \conninfo
>    You are connected to database "fabien" as user "fabien" on host "foo" at 
> port "5432".
>     # NOPE, I'm really connected to localhost, foo does not even exist
>     # Other apparent inconsistencies are possible when hostaddr overrides
>     # "host" which is an socket directory or an IP.

I remain of the opinion that this is not a bug.  You told it that foo
has address 127.0.0.1 and it believed you; that's YOUR fault.

> After the patch:
>
>    sh> psql "host=foo hostaddr=127.0.0.1"
>
>    psql> \conninfo
>    You are connected to database "fabien" as user "fabien" on host "foo" 
> (address "127.0.0.1") at port "5432".
>    # better

Nevertheless, that seems like a reasonable change to the output.  Will
your patch show the IP address in all cases or only when hostaddr is
specified?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Reply via email to