2022-10-10 12:27 Bharath Rupireddy wrote:
if (port->database_name != NULL && port->database_name[0] != '\0') appendStringInfo(&ps_data, "%s ", port->database_name);The above works better.
Thank you for the suggestion. I have edited the patch to reflect your idea. Best, Tatsuhiro Nakamori
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 383bc4776e..e17b62e155 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -4451,7 +4451,7 @@ BackendInitialize(Port *port) if (am_walsender) appendStringInfo(&ps_data, "%s ", GetBackendTypeDesc(B_WAL_SENDER)); appendStringInfo(&ps_data, "%s ", port->user_name); - if (!am_walsender) + if (port->database_name != NULL && port->database_name[0] != '\0') appendStringInfo(&ps_data, "%s ", port->database_name); appendStringInfoString(&ps_data, port->remote_host); if (port->remote_port[0] != '\0')