Re: Fix for Extra Parenthesis in pgbench progress message

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: btogiwarayuushi(at)oss(dot)nttdata(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fix for Extra Parenthesis in pgbench progress message
Date: 2024-11-02 11:43:10
Message-ID: 20241102.204310.303633563778001008.ishii@postgresql.org
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))

Yeah, annoying.

> 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.

The patch works perfectly for the case that there is one extra brace
as shown in your example. However I think it will not work if there
are two or more extra braces.

Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alena Rybakina 2024-11-02 12:22:41 Re: Vacuum statistics
Previous Message Joel Jacobson 2024-11-02 11:08:31 Re: New "raw" COPY format