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 1tJRIE-002z8e-PD for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Dec 2024 05:54:22 +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 1tJRIB-00AEQC-T8 for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Dec 2024 05:54:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJRIB-00AEQ4-KV for pgsql-bugs@lists.postgresql.org; Fri, 06 Dec 2024 05:54:20 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJRI9-001JAo-Vh; Fri, 06 Dec 2024 05:54:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4B65sFiN2751826; Fri, 6 Dec 2024 00:54:15 -0500 From: Tom Lane To: Koichi Suzuki cc: Tatsuo Ishii , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18735: Specific multibyte character in psql file path command parameter for Windows In-reply-to: References: <18735-4acdb3998bb9f2b1@postgresql.org> <2572359.1733424649@sss.pgh.pa.us> <20241206.142130.1661155698933375612.ishii@postgresql.org> Comments: In-reply-to Koichi Suzuki message dated "Fri, 06 Dec 2024 14:26:34 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2751824.1733464455.1@sss.pgh.pa.us> Date: Fri, 06 Dec 2024 00:54:15 -0500 Message-ID: <2751825.1733464455@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Koichi Suzuki writes: > I'm not sure if we can fix src/fe_utils/psqlscan.l and/or > src/bin/psql/psqlscanslash.l for this. Needs some more investigqation. I don't believe the theory that the fault lies there. If the flex rules were taking the backslash-embedded-in-a-shift-JIS-character as a backslash, they would think it is the start of a new backslash command, with the result being that the filename argument gets truncated there. That doesn't match the reported symptoms: we see more of the filename than that echoed back in the error message. So I think the filename is getting through that part just fine, and then we're messing it up in canonicalize_path or adjacent processing. regards, tom lane