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 1qoUOu-001SSZ-5g for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Oct 2023 19:52:48 +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 1qoUOs-00HW4y-2B for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Oct 2023 19:52:46 +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 1qoUOr-00HW2s-I6 for pgsql-hackers@lists.postgresql.org; Thu, 05 Oct 2023 19:52:46 +0000 Received: from dormouse.elm.relay.mailchannels.net ([23.83.212.50]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qoUOp-000CPu-KB for pgsql-hackers@postgresql.org; Thu, 05 Oct 2023 19:52:45 +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 8AC5584119C; Thu, 5 Oct 2023 19:52:41 +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 1E380840C78; Thu, 5 Oct 2023 19:52:41 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1696535561; a=rsa-sha256; cv=none; b=mskqXqhko9JMpGz/9HV4IWU8KIlaVgMHEEiAQjs7IGt3EgbnschsMOmBsoPF7Xkbbco3e+ rZsPHJ4Rj6AslqkY1T11yGgcruYIVMxNRSexnZWLtP2RzUnbz5XXks/BeHDb9KU6RZLJKf 1z74RUq2X9iXyzrLp/VilOFr6/XSi1cq4SfIq2VqaR26QJZmE9smkdJK84mHl5pEG6v1om 70hBx/s4HBePEGgDP/IXmxXKP1ttkeJb/8b6UoWEtBnPkY2koLG9tZxLvYc3WXee5jXY4W oDpG1c4LVKxyT2jdHgHyF93FP2PI4vzw/LnONrAfbIhwEp8Pvwv8mke3+dGZWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1696535561; 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=bdgq0zW4tm0vj8ZO/9IJmxo1//ZDnzxTaNxX+hLOKiw=; b=zoYpJD3ZryIbQ+lRfKJKKoexitVW8zaTHpBWhedMqK6Joag1fJFjYtZUymYOm5dYCtkZeo ifg8efLkGu8gZdZctOhedPRc+QflaMNR4tk1m3Fo28YuACQGrCapJy/d30FbjuOkbPBKeg SAKc0HWmIwPBbSk53x52h6jdSpQ3dUOzhOJcC3CVU2wY2ttMfcxlgG35pIt5SbDlo6uCn8 wzV/h68YmPKo4Cz7fV7zfatjIn6AnqhoPx6XR5TkKwM6rfOgjyNMGjwAC/8Fa0/qnDn2FK SipOO+a38kfGqpHeyoYJhQC1QO5T1CkVGqWBPA78ZEV//NMKmIPMohcBYlznHg== ARC-Authentication-Results: i=1; rspamd-7d5dc8fd68-gml62; 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-Lonely-Imminent: 3fd48b6b7a7c8831_1696535561397_2416487056 X-MC-Loop-Signature: 1696535561397:2528381664 X-MC-Ingress-Time: 1696535561397 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.124.45.11 (trex/6.9.1); Thu, 05 Oct 2023 19:52:41 +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 4S1hzr2GRmz71; Thu, 5 Oct 2023 12:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cryptonector.com; s=dreamhost; t=1696535560; bh=bdgq0zW4tm0vj8ZO/9IJmxo1//ZDnzxTaNxX+hLOKiw=; h=Date:From:To:Cc:Subject:Content-Type; b=X/qjNVkQrxDa1tQDDlbY0JyYHcHmVgW8V27kahYLC1COtNTotUU5XRDdyfuyNGPF9 9yYKrS0RXZ7zu62Y4rdPs6Fei1FaugkpS1t4yFE0Sn9ar7HhUD4I73IdDdfV7YeGLl 4MkFo51Ydw3yXKP1c7EreKlJx2UsmjNCzaQ6qczqGJeW1BsYvcHeGjZbZjEdOET+yI YHUL33wIli28csU2ERkxXCGfqPCz5Au2N5OgZ51gNNfAKICmXQl0PVWIHuahVCvKzf v0OedTnnYEsmocRfoUYf5RcXb8BlbYMb3XOBfQbYzM7CxGG3itCUIBp4sBxiCR7U4+ EkSkXTUntoldw== Date: Thu, 5 Oct 2023 14:52:37 -0500 From: Nico Williams To: Tom Lane Cc: Robert Haas , 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> <2816608.1696535377@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2816608.1696535377@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Oct 05, 2023 at 03:49:37PM -0400, Tom Lane wrote: > Nico Williams writes: > > 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. > > The precedent of BOMs (byte order marks) suggests strongly that > such a solution would be horrible to use. This is just how you encode the type of the string. You have any number of options. The point is that already PG can encode binary data, so if how to encode text of disparate encodings on the wire, building on top of the encoding of bytea is an option.