Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lLpkB-00061x-2W for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Mar 2021 16:06:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lLpjd-00087l-M6 for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Mar 2021 16:06:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lLpjd-00087Z-Fk for pgsql-bugs@lists.postgresql.org; Mon, 15 Mar 2021 16:06:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lLpjW-0007qk-Fk for pgsql-bugs@lists.postgresql.org; Mon, 15 Mar 2021 16:06:24 +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 12FG6GaZ3009596; Mon, 15 Mar 2021 12:06:16 -0400 From: Tom Lane To: Eirik Bakke cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #16926: initdb fails on Windows when binary path contains certain non-ASCII characters In-reply-to: References: <16926-e4ef345545d185ab@postgresql.org> <2932627.1615761527@sss.pgh.pa.us> Comments: In-reply-to Eirik Bakke message dated "Mon, 15 Mar 2021 00:09:45 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3009594.1615824376.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 15 Mar 2021 12:06:16 -0400 Message-ID: <3009595.1615824376@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Eirik Bakke writes: > The installation path can certainly be represented in UTF-8, but a chara= cter set conversion is necessary. Wouldn't "SET CLIENT_ENCODING" accomplis= h this? For example, couldn't initdb in this case do a "SET CLIENT_ENCODIN= G TO 'Windows-1252'" before issuing the COPY command? The issues are (1) how should initdb know that the path name ought to be taken as WIN1252, rather than some other encoding? And then (2) how should the backend know that it must convert the path-name-represented- in-UTF8 to WIN1252 before passing it to the file system? The lack of any standardization about what encoding file names are in is the core of the difficulty. I don't know much about Windows, so it's possible that there actually are platform-specific ways to answer these questions. But it's a generic problem, and we're unlikely to be interested in building a single-platform fix. regards, tom lane