Fix bugs in manipulation of PgBackendStatus.st_clienthostname.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 2 Apr 2014 01:30:11 +0000 (21:30 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 2 Apr 2014 01:30:11 +0000 (21:30 -0400)
commit6cb229d5ad77112156946c42cc91b8cba204072e
tree92bab96e7dda3fd8d8774dfe7b3f1755ce4693d0
parentd747c6da6aedbbf141870136d1782f23c837029c
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.
src/backend/postmaster/pgstat.c
src/backend/utils/adt/pgstatfuncs.c