Re: Enhance pg_stat_wal_receiver view to display connected host
Michael Paquier <michael.paquier@gmail.com>
From: Michael Paquier <michael.paquier@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Haribabu Kommi <kommi.haribabu@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-01-09T01:15:47Z
Lists: pgsql-hackers
On Fri, Jan 05, 2018 at 09:15:36AM -0300, Alvaro Herrera wrote: > Haribabu Kommi wrote: > > > And also not returning "default host" details, because for the conninfo > > without any host details, the return value must be NULL. But this change > > may break the backward compatibility of the function. > > I wouldn't want to have to fight that battle. Hm. Any users of psql's PROMPT would be equally confused, and this can actually lead to more confusion from the user prospective I think than just pg_stat_wal_receiver. If you take the case of Haribabu from upthread with say this bit in psqlrc: \set PROMPT1 '[host=%M;port=%>]=%# ' Then you get on HEAD the following set of results using different connection strings: 1) host=localhost,localhost hostaddr=127.0.0.1,127.0.0.1 port=5432,5433 [host=localhost,localhost;port=5432]=# 2) host=localhost,localhost port=5432,5433 [host=localhost;port=5432]=# 3) hostaddr=127.0.0.1,127.0.0.1 port=5432,5433 [host=[local];port=5432]=# 4) host=/tmp,tmp hostaddr=127.0.0.1,127.0.0.1 [host=[local:/tmp,tmp];port=5432]=# So for cases 2) and 4), mixing both hostaddr and host is hurting the experience. The documentation in [1] also specifies that if both host and hostaddrs are specified then host is ignored. The same rule applies for multiple values so for 2) and 4) the correct values ought to be "local" for both of them. This would be more consistent with the pre-9.6 behavior as well. [1]: https://www.postgresql.org/docs/current/static/libpq-connect.html -- Michael
Commits
-
Enhance pg_stat_wal_receiver view to display host and port of sender server.
- 9a895462d940 11.0 landed
-
Allow multiple hostaddrs to go with multiple hostnames.
- 7b02ba62e9ff 10.0 cited
-
libpq: Fix inadvertent change in PQhost() behavior.
- 11003eb55658 10.0 cited
-
libpq: Allow connection strings and URIs to specify multiple hosts.
- 274bb2b3857c 10.0 cited