Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t7CXT-000bOP-20 for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Nov 2024 11:43:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t7CXQ-005VyC-Fd for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Nov 2024 11:43:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t7CXQ-005Vy3-3R for pgsql-hackers@lists.postgresql.org; Sat, 02 Nov 2024 11:43:28 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t7CXM-00474M-Kr for pgsql-hackers@postgresql.org; Sat, 02 Nov 2024 11:43:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=w2D/BGvxKRBVXhbxxgBhYP4fXh8DcBW/V62Dqbnv9Fw=; b=z1dz97udxGI0G3OqNqXsuFDoRt lzTDYT/v4Rp61sYrkXl1yP/QdvxUevy8zhrtFS1ae29x6HQuiIVVdw79jXgHAnY30L7dgTs4Pdnqp k+VrmnUHJ+S0F2BxtBMpKgtV10QKKTgsi1SaT/hjfNNUx6fdXqsmci2WtOjF7hpGZVXshvSi/6t6/ XnavYdpXVk8N+BekDBhPfPp5ZwrBOO6TQcWee37BBJIVrShnktEf/dMVQBFtTVMqNsYR7oDOuUfdI Dzens9oQCiolURcdZrcaOQh+8ypqS/jjD98z7T2GAKgSqO1a2sFIGpKLjdLnkE4o4aN7EUAJVTNBf tFau/Big==; Received: from [2409:11:4120:300:f67d:b155:e5e7:9cb4] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1t7CXH-00FRB6-VW; Sat, 02 Nov 2024 11:43:23 +0000 Date: Sat, 02 Nov 2024 20:43:10 +0900 (JST) Message-Id: <20241102.204310.303633563778001008.ishii@postgresql.org> To: btogiwarayuushi@oss.nttdata.com Cc: pgsql-hackers@postgresql.org Subject: Re: Fix for Extra Parenthesis in pgbench progress message From: Tatsuo Ishii In-Reply-To: <9a9b8b95b6a709877ae48ad5b0c59bb9@oss.nttdata.com> References: <9a9b8b95b6a709877ae48ad5b0c59bb9@oss.nttdata.com> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:f67d:b155:e5e7:9cb4 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > 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