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 1qo9DA-000JDr-45 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Oct 2023 21:15:16 +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 1qo9D8-005A9f-0c for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Oct 2023 21:15:14 +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 1qo9D7-005A8w-H5 for pgsql-hackers@lists.postgresql.org; Wed, 04 Oct 2023 21:15:14 +0000 Received: from sienna.cherry.relay.mailchannels.net ([23.83.223.165]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qo9D5-0002cJ-LP for pgsql-hackers@postgresql.org; Wed, 04 Oct 2023 21:15:13 +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 D482DC13DA; Wed, 4 Oct 2023 21:15:09 +0000 (UTC) Received: from pdx1-sub0-mail-a296.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 403E1C1EE6; Wed, 4 Oct 2023 21:15:09 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1696454109; a=rsa-sha256; cv=none; b=mkykcnatmJA5JVgajkhpgOaW4p5OV3i0OYG2oxl2gOGbCMQ9oDg2AsodWBUicR8571N2J3 70eS7UBE5vessr16JtOc+kCMYPtbozbMAaRkIfMK3Ac54FibXyqJ5qRS93ebWlXHi1WaSl NYGtIje3kjDR3FxtB19USAA/XVFPjsDZ6qQSmoGroJxMJp7G/SRwkvIrDC+GKZiWYRkQaD DApWbevI89jdP/uy597NJ/invmBHL9V9RVqWiZCkNe3PCYr15+Oy8c1nsyNBtwdgyuOQQt fwR6sWI072hckYzbYM6Uxm72hvEUqb/E26iatTCoq+acXgmHCoh6XgIavOxFew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1696454109; 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=y31zqGKZSZIIyfsjoBW4zpORmhunPsy7oKNj5HuDYeg=; b=rPoVLa6esipzUaRdgdAEFHm656uEf3kW6btulcLQkY6MDAk20xZzkFXEjPCNe9xyHMFlWB 7qbIm8y8x6zDz2j743mdxEq6Cl39sfV4Q/Bk87RjFDOEW7B44Crs6uav/g9HLJ9tJqhPbK d9NnvW85WWG1sJkOw+XHlSX4urQQs2eSHBGwH3/PIVPf4JOIhVY0JqYDEmOmmkBlGZ+eTN ZCRnhDQdP6ljR62yjyDDU4+51QpavMzXfGslDJDjWRX9X9tmvqDzEvr63WKG/L+BoeZKT1 qMWube/Vnq7jIQ98StzqhOG7ZCMRMOPSu/qdbagVX3cpnujT4b/3Lbx0mI5JSQ== ARC-Authentication-Results: i=1; rspamd-7c449d4847-b45ns; 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-Ski-Thread: 5031e522541f9a2b_1696454109672_1937313577 X-MC-Loop-Signature: 1696454109672:4246423406 X-MC-Ingress-Time: 1696454109672 Received: from pdx1-sub0-mail-a296.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.97.162.150 (trex/6.9.1); Wed, 04 Oct 2023 21:15:09 +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-a296.dreamhost.com (Postfix) with ESMTPSA id 4S16sS4NGWz6D; Wed, 4 Oct 2023 14:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cryptonector.com; s=dreamhost; t=1696454109; bh=y31zqGKZSZIIyfsjoBW4zpORmhunPsy7oKNj5HuDYeg=; h=Date:From:To:Cc:Subject:Content-Type; b=WHoi73uTQvQkNEvQ9ooQ41KW6DVgmEKz5AO9S8+zPqxMAlAdxiAZVCV/NfmhRqYB8 BaeAyXFetmNvO3Vg3y4K5fYjGU8+hg5Cy1x1IPB3tV79edT+Wx6+zFI1eQi9dD6nVg 6gi/I2iJm4VMcEGYR1v5/4XrgHHiiVim8WGQdTZgXhlfOCHM7vYDsNfoHFYvHwtmlV MKyF3wZK/zdyQQcCvwjpYY0un7DE2+3ad3ZgvX06H2KZNozz437P/vIfHgs4PCR/C/ W+V89BZWrbfV1RDGYsbxpKYfFkZ8Ewk5HBfebBVoGDqQewlvnBkpR9TBSeygjKpNex L81fdxdPnlSgw== Date: Wed, 4 Oct 2023 16:15:06 -0500 From: Nico Williams To: Jeff Davis Cc: Chapman Flack , Robert Haas , pgsql-hackers@postgresql.org Subject: Re: Pre-proposal: unicode normalized text Message-ID: References: <43864caecd65d02081d623d05ccc1683@anastigmatix.net> 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 Wed, Oct 04, 2023 at 01:38:15PM -0700, Jeff Davis wrote: > On Wed, 2023-10-04 at 14:02 -0400, Chapman Flack wrote: > > The SQL standard would have me able to: > > > > [...] > > _UTF8'Hello, world!' and _LATIN1'Hello, world!' > > Is there a use case for that? UTF-8 is able to encode any unicode code > point, it's relatively compact, and it's backwards-compatible with 7- > bit ASCII. If you have a variety of text data in your system (and in > many cases even if not), then UTF-8 seems like the right solution. > > Text data encoded 17 different ways requires a lot of bookkeeping in > the type system, and it also requires injecting a bunch of fallible > transcoding operators around just to compare strings. Better that than TEXT blobs w/ the encoding given by the `CREATE DATABASE` or `initdb` default! It'd be a lot _less_ fragile to have all text tagged with an encoding (indirectly, via its type which then denotes the encoding). That would be a lot of work, but starting with just a UTF-8 text type would be an improvement. Nico --