Re: ps command does not show walsender's connected db - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: ps command does not show walsender's connected db
Date
Msg-id CALj2ACVTA01c1bncoXD+kTNo2f-B7b9oXznObB+qwasB0KssWA@mail.gmail.com
Whole thread Raw
In response to Re: ps command does not show walsender's connected db  (bt22nakamorit <bt22nakamorit@oss.nttdata.com>)
Responses Re: ps command does not show walsender's connected db
List pgsql-hackers
On Mon, Oct 10, 2022 at 8:00 AM bt22nakamorit
<bt22nakamorit@oss.nttdata.com> wrote:
>
> appendStringInfo will append extra space after null (since "%s "), so
> the ps entry will look less neat in that case.
> How about we check whether port->database_name is null or not, instead
> of making it unconditional?
> It will look like this.
> -    if (!am_walsender)
> +    if (port->database_name != NULL)
>          appendStringInfo(&ps_data, "%s ", port->database_name);

if (port->database_name != NULL && port->database_name[0] != '\0')
    appendStringInfo(&ps_data, "%s ", port->database_name);

The above works better.

-- 
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Remove an unnecessary LSN calculation while validating WAL page header
Next
From: Amit Kapila
Date:
Subject: Re: create subscription - improved warning message