Re: primary_conninfo missing from pg_stat_wal_receiver - Mailing list pgsql-hackers

From Robert Haas
Subject Re: primary_conninfo missing from pg_stat_wal_receiver
Date
Msg-id CA+Tgmoam_quHMBZJBi4yTvgr9qsAAXhk6WZULeOkta2rnO2Gsg@mail.gmail.com
Whole thread Raw
In response to Re: primary_conninfo missing from pg_stat_wal_receiver  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Thu, Jun 30, 2016 at 10:24 AM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Also, actually, I see no reason for the conninfo to be shown differently
> regardless of a connection being already established.  If we show the
> conninfo that the server is trying to use, it might be easier to
> diagnose a problem.  In short, I think this is all misconceived (mea
> culpa) and that we should have two conninfo members in that struct as
> initially proposed, one obfuscated and the other not.

Seriously!

The whole problem here is being created by trying to use the same
field for two different purposes:

1. The string that should actually be used for connections.
2. The sanitized version that should be exposed to the user.

If you try to use the same variable to store two different values,
both bugs and confusion may result.

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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Issue with bgworker, SPI and pgstat_report_stat
Next
From: Robert Haas
Date:
Subject: Re: Reviewing freeze map code