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 1tJQWe-002v6j-EA for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Dec 2024 05:05:12 +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 1tJQWa-009y10-GD for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Dec 2024 05:05:09 +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 1tJQWa-009y0s-70 for pgsql-bugs@lists.postgresql.org; Fri, 06 Dec 2024 05:05:09 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJQWU-001ITL-Lb for pgsql-bugs@lists.postgresql.org; Fri, 06 Dec 2024 05:05:07 +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 4B6550YB2744316; Fri, 6 Dec 2024 00:05:01 -0500 From: Tom Lane To: Koichi Suzuki cc: 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> Comments: In-reply-to Koichi Suzuki message dated "Fri, 06 Dec 2024 13:12:50 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2744314.1733461500.1@sss.pgh.pa.us> Date: Fri, 06 Dec 2024 00:05:00 -0500 Message-ID: <2744315.1733461500@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Koichi Suzuki writes: > Lexical analysis of backshash commands in psql is handled > by psqlscanslash.l and this module scans iput byte-by-byte, not > character-by-character. I'm afraid that the cause of the bug is in > this part.. Is there any way to make this flex syntax local-dependent? I think you're mistaken: see the "safe_encoding" hackery in psqlscan.l (which does also operate for the rules in psqlscanslash.l). Now it could be that psqlscan.l has been misinformed about the encoding that's in use, but that wouldn't be its fault. regards, tom lane