Fix bugs in manipulation of PgBackendStatus.st_clienthostname.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: e83bee8ddcc75881002efb69a293b2b9d1d2be78
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2014-04-02T01:30:14Z
Releases: 9.2.9
Fix bugs in manipulation of PgBackendStatus.st_clienthostname.

Initialization of this field was not being done according to the
st_changecount protocol (it has to be done within the changecount increment
range, not outside).  And the test to see if the value should be reported
as null was wrong.  Noted while perusing uses of Port.remote_hostname.

This was wrong from the introduction of this code (commit 4a25bc145),
so back-patch to 9.1.

Files

PathChange+/−
src/backend/postmaster/pgstat.c modified +5 −4
src/backend/utils/adt/pgstatfuncs.c modified +2 −1