On Mon, Oct 10, 2022 at 8:00 AM bt22nakamorit
<bt22nakamo...@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


Reply via email to