Re: pgbench: make verbose error messages thread-safe - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: pgbench: make verbose error messages thread-safe
Date
Msg-id CAHGQGwGn3o8JOd+-u42tebtsRfdhgKGEsy+3SFR82=u=jfdDrQ@mail.gmail.com
Whole thread
In response to Re: pgbench: make verbose error messages thread-safe  (Chao Li <li.evan.chao@gmail.com>)
List pgsql-hackers
On Fri, Apr 24, 2026 at 6:06 PM Chao Li <li.evan.chao@gmail.com> wrote:
> I am not too worried about that, because this code path is only used with --verbose-errors and only when printing
errormessages. In that situation, the cost of one extra memory allocation per log line should be much smaller than the
I/Ocost of writing the log message itself. So I think the simpler fix is probably acceptable. 

Yes, I feel the same way.


> But if we really care about the performance problem, I think PQExpBuffer might be better stored in TState that is per
thread,while CState is per connection. 

Agreed.

Regards,

--
Fujii Masao



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Parallel Apply
Next
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Parallel Apply