Re: pgbench - use pg logging capabilities

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench - use pg logging capabilities
Date: 2020-01-09 09:28:21
Message-ID: alpine.DEB.2.21.2001090649020.25403@pseudo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bonjour Michaël,

>> I don't follow what you mean by that.
> The first versions of the patch did not change syntax_error(), and the
> version committed has switched to use PQExpBufferData there. I think
> that we should just do the same for the debug logs executing the meta
> commands. This way, we get an output consistent with what's printed
> out for sending or receiving stuff. Please see the attached.

Yep, I thought of it, but I was not very keen on having a malloc/free
cycle just for one debug message. However under debug this is probably not
an issue.

Your patch works for me. IT can avoid some level of format interpretation
overheads by switching to Char/Str functions, see first attachement.

The other point is the test on __pg_log_level, see second attached.


Attachment Content-Type Size
pgbench-logs-2.patch text/x-diff 803 bytes
pgbench-log-level-1.patch text/x-diff 2.4 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-01-09 09:49:10 Re: Change atoi to strtol in same place
Previous Message Peter Eisentraut 2020-01-09 09:20:14 Re: Unicode normalization SQL functions