Re: A few message wording/formatting cleanup patches - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: A few message wording/formatting cleanup patches
Date
Msg-id 20260602.134356.653346963021072409.horikyota.ntt@gmail.com
Whole thread
Responses Re: A few message wording/formatting cleanup patches
List pgsql-hackers
Hello. Thank you for the comments.

At Mon, 1 Jun 2026 17:18:13 +0530, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote in 
> 1. There are other places in the function where we use similar code.
> Those places call initStringInfo just before getRelationDescription()
> is called and then pfree() StringInfoData.data after it is added to
> the object description.

That's a good point. I hadn't paid much attention to that because the
allocation is short-lived, but matching the surrounding code is
probably better. I've added pfree() in the attached patch.

> 2. Why do we want to capture the output of getObjectDescription() in a
> StringInfo and then add it to the buffer? I think we can pass
> getObjectDescription directly as an argument to appendStringInfo()
> similar to the code for case AttrDefaultRelationId.

I considered returning strings from helper functions such as
getRelationDescription(), but that would affect a number of similar
helper functions and broaden the scope of the patch.

While working on this, I noticed that the string returned by
getObjectDescription() in the AttrDefaultRelationId case is not
pfree'd. Since that appears unrelated to this patch, I left it as-is.

I also dropped the assertions on the temporary description strings.
They were mainly there while developing the patch and don't seem
necessary in the final version.

Thanks!

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: pgsql: Advance restart_lsn more eagerly in LogicalConfirmReceivedLocati
Next
From: Andrey Borodin
Date:
Subject: Re: injection_points: Switch wait/wakeup to use atomics rather than latches