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 CALj2ACWVucn+qXuH3g0yPS0cHitpGsBEztJ222dVPAy2dpZLQw@mail.gmail.com
Whole thread Raw
In response to Re: ps command does not show walsender's connected db  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: ps command does not show walsender's connected db
List pgsql-hackers
On Fri, Oct 7, 2022 at 7:25 PM Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
>
> Thanks for updating the patch! LGTM.

-    if (!am_walsender)
+    if (!am_walsender || am_db_walsender)
         appendStringInfo(&ps_data, "%s ", port->database_name);

Can the appendStringInfo be just unconditional? That is more readable
IMO. We want the database_name to be appended whenever it isn't null.
The only case we expect database_name to be null is for walsenders
serving streaming replication standbys and even when database_name is
null, nothing gets appended, it's just the appendStringInfo() call
gets wasted, but that's okay.

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



pgsql-hackers by date:

Previous
From: "Anton A. Melnikov"
Date:
Subject: Re: [BUG] Logical replica crash if there was an error in a function.
Next
From: Tom Lane
Date:
Subject: Simplifying our Trap/Assert infrastructure