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 1qiUEe-006YZF-0y for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Sep 2023 06:29:24 +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 1qiUEc-0071MJ-9R for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Sep 2023 06:29:22 +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 1qiUEb-0071M1-UQ for pgsql-hackers@lists.postgresql.org; Tue, 19 Sep 2023 06:29:21 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiUEV-005OPV-PU for pgsql-hackers@lists.postgresql.org; Tue, 19 Sep 2023 06:29:20 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 3416D612A1; Tue, 19 Sep 2023 15:29:11 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at oss.nttdata.com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_34b1321f0628e8c55fb026937566a9b9" Content-Transfer-Encoding: 7bit Date: Tue, 19 Sep 2023 15:29:11 +0900 From: Ryoga Yoshida To: Michael Paquier Cc: Aleksander Alekseev , pgsql-hackers@lists.postgresql.org, Kyotaro Horiguchi Subject: Re: Bug fix for psql's meta-command \ev In-Reply-To: References: <01419622d84ef093fd4fe585520bf03c@oss.nttdata.com> <20230915.151750.1163612305682721014.horikyota.ntt@gmail.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: bt23yoshidar@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=_34b1321f0628e8c55fb026937566a9b9 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 2023-09-19 12:53, Michael Paquier wrote: > Adding a comment looks important to me once we consider the edit as a > path that can fail and the edited query is only executed then reset > when we have PSQL_CMD_NEWEDIT as status. I would suggest the patch > attached instead, taking care of the error case of this thread and the > ones I've spotted. Thank you everyone for the reviews. I fixed the patch for the error and also added a comment . You can see attached file. Ryoga Yoshida --=_34b1321f0628e8c55fb026937566a9b9 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=bug_fix_for_ev_command_2.patch Content-Disposition: attachment; filename=bug_fix_for_ev_command_2.patch; size=531 ZGlmZiAtLWdpdCBhL3NyYy9iaW4vcHNxbC9jb21tYW5kLmMgYi9zcmMvYmluL3BzcWwvY29tbWFu ZC5jCmluZGV4IGJjZDhlYjM1MzguLmViMzA2ZDhkNzcgMTAwNjQ0Ci0tLSBhL3NyYy9iaW4vcHNx bC9jb21tYW5kLmMKKysrIGIvc3JjL2Jpbi9wc3FsL2NvbW1hbmQuYwpAQCAtMTIzOSw2ICsxMjM5 LDE1IEBAIGV4ZWNfY29tbWFuZF9lZl9ldihQc3FsU2NhblN0YXRlIHNjYW5fc3RhdGUsIGJvb2wg YWN0aXZlX2JyYW5jaCwKIAkJCQlzdGF0dXMgPSBQU1FMX0NNRF9ORVdFRElUOwogCQl9CiAKKwkJ aWYgKHN0YXR1cyA9PSBQU1FMX0NNRF9FUlJPUikKKwkJeworCQkJLyoKKwkJCSAqIGNsZWFyIHRo ZSBxdWVyeSBidWZmZXIgYmVjYXVzZSBpdCBjb3VsZCBiZSBvdmVyd3JpdHRlbiB3aXRoCisJCQkg KiBhbiBpbmNvbXBsZXRlIHF1ZXJ5IHN0cmluZyBkdWUgdG8gY2VydGFpbiBmYWlsdXJlcy4KKwkJ CSAqLworCQkJcmVzZXRQUUV4cEJ1ZmZlcihxdWVyeV9idWYpOworCQl9CisKIAkJZnJlZShvYmpf ZGVzYyk7CiAJfQogCWVsc2UK --=_34b1321f0628e8c55fb026937566a9b9--