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 1kPbJa-0002eO-R5 for pgsql-general@arkaria.postgresql.org; Tue, 06 Oct 2020 00:58:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kPbJZ-000141-Ei for pgsql-general@arkaria.postgresql.org; Tue, 06 Oct 2020 00:58:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPbJZ-00013r-6i for pgsql-general@lists.postgresql.org; Tue, 06 Oct 2020 00:58:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPbJX-00017Q-0w for pgsql-general@postgresql.org; Tue, 06 Oct 2020 00:58:48 +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 0960wgqN1831166; Mon, 5 Oct 2020 20:58:43 -0400 From: Tom Lane To: Tatsuo Ishii cc: parker.han@outlook.com, pgsql-general@postgresql.org Subject: Re: =?utf-8?B?5Zue5aSNOg==?= May "PostgreSQL server side GB18030 character set support" reconsidered? In-reply-to: <20201006.090410.1264557007598736613.t-ishii@sraoss.co.jp> References: <20201005.174109.1358847281635212616.t-ishii@sraoss.co.jp> <1720141.1601908234@sss.pgh.pa.us> <20201006.090410.1264557007598736613.t-ishii@sraoss.co.jp> Comments: In-reply-to Tatsuo Ishii message dated "Tue, 06 Oct 2020 09:04:10 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1831164.1601945922.1@sss.pgh.pa.us> Date: Mon, 05 Oct 2020 20:58:42 -0400 Message-ID: <1831165.1601945922@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tatsuo Ishii writes: > One of ideas to avoid the concern could be "shifting" GB18030 code > points into "ASCII safe" code range with some calculations so that > backend can handle them without worrying about the concern above. This > way, we could avoid a table lookup overhead which is necessary in > conversion between GB18030 and UTF8 and so on. Hmm ... interesting idea, basically invent our own modified version of GB18030 (or SJIS?) for backend-internal storage. But I'm not sure how to make it work without enlarging the string, which'd defeat the OP's argument. It looks to me like the second-byte code space is already pretty full in both encodings. regards, tom lane