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