diff options
-rw-r--r-- | src/backend/postmaster/postmaster.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 3cba0e5f50e..7e3fd0d3fde 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -4068,6 +4068,14 @@ BackendInitialize(Port *port) else snprintf(remote_ps_data, sizeof(remote_ps_data), "%s(%s)", remote_host, remote_port); + /* + * Save remote_host and remote_port in port structure (after this, they + * will appear in log_line_prefix data for log messages). + */ + port->remote_host = strdup(remote_host); + port->remote_port = strdup(remote_port); + + /* And now we can issue the Log_connections message, if wanted */ if (Log_connections) { if (remote_port[0]) @@ -4082,12 +4090,6 @@ BackendInitialize(Port *port) } /* - * save remote_host and remote_port in port structure - */ - port->remote_host = strdup(remote_host); - port->remote_port = strdup(remote_port); - - /* * If we did a reverse lookup to name, we might as well save the results * rather than possibly repeating the lookup during authentication. * |