On Fri, Mar 18, 2022 at 2:15 AM Nathan Bossart <nathandboss...@gmail.com> wrote: > > On Thu, Mar 17, 2022 at 06:48:43PM +0530, Bharath Rupireddy wrote: > > Personally, I tend to agree with v4-0001 (option (4)) or v4-0002 > > (option (3)) than v4-0003 (option (1)) as it adds more unreadability > > with most of the code duplicated creating more diff with previous > > versions and maintainability problems. Having said that, I will leave > > it to the committer to decide on that. > > I don't think v4-0003/option 1 needs to be unreadable. Perhaps we can use > a StringInfo to build the message. That might be a net improvement in > readability anyway.
Looks like we already use StringInfo in PerformAuthentication for "connection" related log messages, see [1]. I will give it a try using StringInfo for the "checkpoint/restartpoint complete" message too. [1] if (Log_connections) { StringInfoData logmsg; initStringInfo(&logmsg); if (am_walsender) appendStringInfo(&logmsg, _("replication connection authorized: user=%s"), port->user_name); else appendStringInfo(&logmsg, _("connection authorized: user=%s"), port->user_name); if (!am_walsender) appendStringInfo(&logmsg, _(" database=%s"), port->database_name); Regards, Bharath Rupireddy.