Re: fix psql \conninfo & \connect when using hostaddr
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Artur Zakirov <a.zakirov@postgrespro.ru>
Date: 2018-11-07T21:06:45Z
Lists: pgsql-hackers
On Fri, Oct 26, 2018 at 9:54 AM Fabien COELHO <coelho@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
Commits
-
Tweak libpq's PQhost, PQhostaddr, and psql's \connect
- 313f56ce2d1b 12.0 landed
-
psql: Show IP address in \conninfo
- 6e5f8d489acc 12.0 landed