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 1qoToP-001PjV-FX for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Oct 2023 19:15:05 +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 1qoToN-00Gz52-By for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Oct 2023 19:15:04 +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 1qoToM-00Gz4D-Ri for pgsql-hackers@lists.postgresql.org; Thu, 05 Oct 2023 19:15:03 +0000 Received: from hamster.birch.relay.mailchannels.net ([23.83.209.80]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qoToK-000C1p-VJ for pgsql-hackers@postgresql.org; Thu, 05 Oct 2023 19:15:02 +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 4BF0341C13; Thu, 5 Oct 2023 19:14:58 +0000 (UTC) Received: from pdx1-sub0-mail-a234.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id CEB6041FC6; Thu, 5 Oct 2023 19:14:57 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1696533297; a=rsa-sha256; cv=none; b=uBEntCQE7L3QJtZwkyocYhxL811885vizn56TicDrHVJ71RO58KQfts05Ii49Op15QkUe6 Ctb7fHggpygbxLUd5hvxwnOiaYim9UNPs9TukUShMyUGnMxHKqsnuA9ffeqwzh8lrjl/uo P9Usa5WNWNvPhcd055SERYJrXVC//Vs2lRc5PvUZLLZlh7jPz2dO1fSD8vgjrvab9r58lG PXFmXWp5RtjeUO6ZjfD2Cx8uMGMZguBGCEUPK9QEvebOxJUA2FI5X6WyBTVlKG2iJKeSBe 4UgK2kVckc2bCIZf6RZHDQ+Bol/4r2Z6pI/G0c5lndiyiBtDNWVDRutFtrhbgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1696533297; 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=0YhRKdNs8ACVikTwR8iKsbMXM93UyPVR9vJuakTFX0g=; b=EMNSNwYzhKaXX6Cjkw7n+69svIS+cR1wnHkyqznLNfpf+O58p77GIQReETtbyE1F4f9gOk YTlJ5BI6BPyIZdbIu6EQ5gR7msXHfJDAsp8uVVy+Cf0MRlgmSaQl+JusshlZd3OyDkLRZu O+YSeNNPa6dlA5fXGIkF3xjF1i1SHqjRF+94ueY3yKr56RGa8Z1bYQybVscdg+Ik7wZfux vZsmzt26Qx7XOV/Z1uzSYABuErUL6wd0qW+xxV6d2yESTQkZGlVp097qmWLDXHs4cboI6k n8VqfGJyrsZmEOZB7CbrGmDnRjIddTtzIESGwM7HKwywwOSpTTFEcNtpMccSRA== ARC-Authentication-Results: i=1; rspamd-7d5dc8fd68-w4tc5; 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-Dime-Chief: 2aecba0d2c84cee4_1696533298123_541255325 X-MC-Loop-Signature: 1696533298123:1738641690 X-MC-Ingress-Time: 1696533298123 Received: from pdx1-sub0-mail-a234.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.109.110.212 (trex/6.9.1); Thu, 05 Oct 2023 19:14:58 +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-a234.dreamhost.com (Postfix) with ESMTPSA id 4S1h8K0Swnz22; Thu, 5 Oct 2023 12:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cryptonector.com; s=dreamhost; t=1696533297; bh=0YhRKdNs8ACVikTwR8iKsbMXM93UyPVR9vJuakTFX0g=; h=Date:From:To:Cc:Subject:Content-Type; b=NgtJqRoxD9kSd+mO2ko0Amg6jQjjTGLrfRFEeFXtHLWXR35vT3QV5BmjEox/7ItOe 4lFRSW6qVLspbE14w+cAt2qEU3tgS+xHbsrf+OXdi2Vz/doGiANjcK4JqxXxnKHxTA fgqxbD0Zz2IujIjyOqaBNu1S3IiNz+jEUXooHc/MlostYFo1PBxkYaHpkWqX7elfhg QgglRgr9nvSEJvgBNHJEZJsncOGhmGS//uAsVpTv540L6sgLkKgBueaIHh+x2ekX3d SUEVz342UT/pBbkECbOBLBkSYZeH9bELJFIPirf2D2InLM4xNXbDjYd7UxyGMppv53 +QPLPAwD8MudA== Date: Thu, 5 Oct 2023 14:14:54 -0500 From: Nico Williams To: Robert Haas Cc: Isaac Morland , Jeff Davis , Chapman Flack , pgsql-hackers@postgresql.org Subject: Re: Pre-proposal: unicode normalized text Message-ID: References: <43864caecd65d02081d623d05ccc1683@anastigmatix.net> <94a0e631b787d56fec1b17e03fe045b5e14907c1.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Oct 05, 2023 at 07:31:54AM -0400, Robert Haas wrote: > [...] On the other hand, to do that in PostgreSQL, we'd need to > propagate the character set/encoding information into all of the > places that currently get the typmod and collation, and that is not a > small number of places. It's a lot of infrastructure for the project > to carry around for a feature that's probably only going to continue > to become less relevant. Text+encoding can be just like bytea with a one- or two-byte prefix indicating what codeset+encoding it's in. That'd be how to encode such text values on the wire, though on disk the column's type should indicate the codeset+encoding, so no need to add a prefix to the value. Complexity would creep in around when and whether to perform automatic conversions. The easy answer would be "never, on the server side", but on the client side it might be useful to convert to/from the locale's codeset+encoding when displaying to the user or accepting user input. If there's no automatic server-side codeset/encoding conversions then the server-side cost of supporting non-UTF-8 text should not be too high dev-wise -- it's just (famous last words) a generic text type parameterized by codeset+ encoding type. There would not even be a hard need for functions for conversions, though there would be demand for them. But I agree that if there's no need, there's no need. UTF-8 is great, and if only all PG users would just switch then there's not much more to do. Nico --