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 1qoA9x-000M78-Mr for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Oct 2023 22:16:01 +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 1qoA9v-005yvQ-7Q for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Oct 2023 22:16:00 +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 1qoA9u-005yrT-HI for pgsql-hackers@lists.postgresql.org; Wed, 04 Oct 2023 22:15:59 +0000 Received: from serval.cherry.relay.mailchannels.net ([23.83.223.163]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qoA9q-000477-2V for pgsql-hackers@postgresql.org; Wed, 04 Oct 2023 22:15:58 +0000 X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id D60995005DA; Wed, 4 Oct 2023 22:15:50 +0000 (UTC) Received: from pdx1-sub0-mail-a202.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 6936B500B75; Wed, 4 Oct 2023 22:15:50 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1696457750; a=rsa-sha256; cv=none; b=HFoaB1jPGGqjk6wdxwuAUlXYlYEb8b07ZIB+/BoQFAQmTAzK7zbfSgDfO8v9GpA0HAAzUp Kn8z+TEAEKP5hnn++c2mpKQ79yG7ifXW0tMj2mxSp1qbLagQ4UEdufocTWRzzsJsNXu1es L9iFJWR4lHVThkjSMwlBnI/btMIjP9dgwe7jySBj68EN+TDtAPVi2kOFTAQssvMdoC9qeD xL1t6MVYIu0iwDvv15kQmRUiKAX/O6YYX3xHVe11I1h/7L3VhRXtI3P/iPwQFuKa4+nMqI DBQ4ymkyr5USLHGrGhIMFNJKA1sn+dXPP9azXQt0pbCjDUSEzQ69+BPCh+NcsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1696457750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=z+lSnZB25hzlY+KNtYkXLDrZh2hK16aJFFyzvux6ETk=; b=vCTVTwJJ5FUauukDyUhYOc1UO08U87YCB+EelLxBP74ikyIkzK3+HV1D5sjxBVrksqxu+n I835x8h6B2RNuTSOMNJd/rRzVSwe7moEYypDWJ1/8ys6WgJlVljfkEsH+7Rvp9l/uIhrpZ NAG02WvZCBonCT5LRplVvtKMj3uy2ddM1GBBUAc4genRjv+0+NUnkag0dSRIgSWLf3Mml5 +rlXqvEkU/CMJLem7hekGb/PjUbyoFdaRLFrUFvlPPeGUehYLKppew1Bqeb7AnGeTHSYhj VeFmgzVmCn/OcjqRuSMMiQu0Mi0rk4K4rvBSJIDVS+VWUsRyyFI74J/Hvrxawg== ARC-Authentication-Results: i=1; rspamd-7d5dc8fd68-7sg4s; auth=pass smtp.auth=dreamhost smtp.mailfrom=nico@cryptonector.com X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|nico@cryptonector.com X-MailChannels-Auth-Id: dreamhost X-Robust-Tank: 1e8642ce1bdf815c_1696457750677_178556582 X-MC-Loop-Signature: 1696457750677:2997023776 X-MC-Ingress-Time: 1696457750677 Received: from pdx1-sub0-mail-a202.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.120.41.146 (trex/6.9.1); Wed, 04 Oct 2023 22:15:50 +0000 Received: from ubby21 (075-081-095-064.res.spectrum.com [75.81.95.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by pdx1-sub0-mail-a202.dreamhost.com (Postfix) with ESMTPSA id 4S18CT5Qslz96; Wed, 4 Oct 2023 15:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cryptonector.com; s=dreamhost; t=1696457750; bh=z+lSnZB25hzlY+KNtYkXLDrZh2hK16aJFFyzvux6ETk=; h=Date:From:To:Cc:Subject:Content-Type; b=fomS/3EC5kh0vx/E/6Y3ToQvLPHD1rwuOdi7REYcGZ5jIWHNORe9JrsYlXC93n9Vi uTGc2asD6D5Ji2hpG1etm81qtArkn3Ac0jIbGqB5OlIlz36ENpS14/efWb6BV+mNWs vLdkgDRiRT3vLiiVfznNLeyPy34WZlxhm+hy1a4aB/4xYF6QmmmZgQGnnGDfP/56DY l5hl9t3v47ddJ7jjdqeFeARmqUQUIo6QmSni6E9J2oR010d6L2NHmyfJn16bQLo+9k Ke/mI18ZTgORE+y9mB2U292SDLkkrQ6aOeM+s5jrN/Elly/Y9qSVrPs/3KPgQZ8vU6 bjF+Hk94Q3bLA== Date: Wed, 4 Oct 2023 17:15:47 -0500 From: Nico Williams To: Chapman Flack Cc: Jeff Davis , Robert Haas , pgsql-hackers@postgresql.org Subject: Re: Pre-proposal: unicode normalized text Message-ID: References: <43864caecd65d02081d623d05ccc1683@anastigmatix.net> <02d05bc98ca5b2d8ab38fec5fe5b7625@anastigmatix.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02d05bc98ca5b2d8ab38fec5fe5b7625@anastigmatix.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Oct 04, 2023 at 05:32:50PM -0400, Chapman Flack wrote: > Well, for what reason does anybody run PG now with the encoding set > to anything besides UTF-8? I don't really have my finger on that pulse. Because they still have databases that didn't use UTF-8 10 or 20 years ago that they haven't migrated to UTF-8? It's harder to think of why one might _want_ to store text in any encoding other than UTF-8 for _new_ databases. Though too there's no reason that it should be impossible other than lack of developer interest: as long as text is tagged with its encoding, it should be possible to store text in any number of encodings. > Could it be that it bloats common strings in their local script, and > with enough of those to store, it could matter to use the local > encoding that stores them more economically? UTF-8 bloat is not likely worth the trouble. UTF-8 is only clearly bloaty when compared to encodings with 1-byte code units, like ISO-8859-*. For CJK UTF-8 is not much more bloaty than native non-Unicode encodings like SHIFT_JIS. UTF-8 is not much bloatier than UTF-16 in general either. Bloat is not really a good reason to avoid Unicode or any specific TF. > Also, while any Unicode transfer format can encode any Unicode code > point, I'm unsure whether it's yet the case that {any Unicode code > point} is a superset of every character repertoire associated with > every non-Unicode encoding. It's not always been the case that Unicode is a strict superset of all currently-in-use human scripts. Making Unicode a strict superset of all currently-in-use human scripts seems to be the Unicode Consortium's aim. I think you're asking why not just use UTF-8 for everything, all the time. It's a fair question. I don't have a reason to answer in the negative (maybe someone else does). But that doesn't mean that one couldn't want to store text in many encodings (e.g., for historical reasons). Nico --