Fix for Extra Parenthesis in pgbench progress message

From: Yushi Ogiwara <btogiwarayuushi(at)oss(dot)nttdata(dot)com>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Fix for Extra Parenthesis in pgbench progress message
Date: 2024-10-31 05:18:09
Message-ID: 9a9b8b95b6a709877ae48ad5b0c59bb9@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I noticed an issue in the pgbench progress message where an extra
closing parenthesis )) appears, as shown below:

7000000 of 10000000 tuples (70%) of pgbench_accounts done (elapsed 19.75
s, remaining 8.46 s))

This occurs when running commands like pgbench -i -s100 and is caused by
leftover characters when using \r with fprintf. I made a patch to
address this by adding extra spaces before \r, which clears any
remaining characters. While effective, I recognize this solution may not
be the most sophisticated.

A more refined solution, such as using string padding, might be ideal
for cases like this.

Best,
Yushi Ogiwara

Attachment Content-Type Size
fix_leftover_character.diff text/x-diff 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2024-10-31 05:48:54 Re: Segfault in jit tuple deforming on arm64 due to LLVM issue
Previous Message Bertrand Drouvot 2024-10-31 05:09:56 Re: per backend I/O statistics