Re: Enhancing Memory Context Statistics Reporting

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Rahila Syed <rahilasyed90(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Enhancing Memory Context Statistics Reporting
Date: 2025-04-30 10:43:24
Message-ID: 02E42650-0C66-4B49-93CA-1B0A5B73E7FD@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 30 Apr 2025, at 12:14, Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> On 29.04.25 15:13, Rahila Syed wrote:
>> Please find attached a patch with some comments and documentation changes.
>> Additionaly, added a missing '\0' termination to "Remaining Totals" string.
>> I think this became necessary after we replaced dsa_allocate0()
>> with dsa_allocate() is the latest version.
>
> > strncpy(nameptr, "Remaining Totals", namelen);
> > + nameptr[namelen] = '\0';
>
> Looks like a case for strlcpy()?

True. I did go ahead with the strncpy and nul terminator assignment, mostly
out of muscle memory, but I agree that this would be a good place for a
strlcpy() instead.

--
Daniel Gustafsson

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-04-30 10:47:51 Re: Accounting for metapages in genericcostestimate()
Previous Message Peter Eisentraut 2025-04-30 10:14:26 Re: Enhancing Memory Context Statistics Reporting