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 1rZi76-005znY-7w for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Feb 2024 02:01:36 +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 1rZi74-00ErGj-I7 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Feb 2024 02:01:34 +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 1rZi74-00ErGa-8e for pgsql-hackers@lists.postgresql.org; Tue, 13 Feb 2024 02:01:34 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rZi71-006Sig-Bt for pgsql-hackers@postgresql.org; Tue, 13 Feb 2024 02:01:32 +0000 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6da202aa138so2580155b3a.2 for ; Mon, 12 Feb 2024 18:01:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1707789690; x=1708394490; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=uxKsVH6MCFkNFfAkd6f6LbJ8R8MY4tE2KZoIzgPCLek=; b=YjJCrWV3+CFKmtJlVVKdGlW2dzGgWRJxkA50kWymTb8HdiFAyOlxU3CRFJoIGMz/VQ aY/YR/9IfUBGRToHXk7vuANViehEfXpmbt1QrXuBt52DPyUiXK7ThlsXYOkGatziB2If F18PHtlrzMBwfDg0pcZ3U1lUAtPmB1KQJevHOzk3GFs/etHyOi5b/dOhSOtuEZOn4OmX 4MxZep567Xl54Q8ZAW1QlmSSbTGM7s2E0HmJGWue+E65CeHxvJi6WQ2p7WdyEAvylogV /fdCsP9EjS01cMXpYESSj3rOsjRjXqvrAdUFeyaEwaT4gM7Csf7ySNnPCwW7XacwdDKa pJ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707789690; x=1708394490; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uxKsVH6MCFkNFfAkd6f6LbJ8R8MY4tE2KZoIzgPCLek=; b=N/pGryDD7Q0nPSsecYES7mm0JZODBsbAoqDvTvF1hlu/xw2RPayt3VQ0mid8Dg1fuo 465FaOkMQlMPYJPFlT0iA6humpUgpA3m1DK1aXUFC7ztR+p65QWG6dUcVQYQm/ZT1W4h YIdR6DOXzuxNr1CyzG0dPjzF6LTX29RQ6Mn9k+T3XRJTx6LxkxObmvW7cZr2H9ehUVRc ZjsIl0HqtcSe8Ni+LuUH3ZVOUNjlxGbl8FAZ7rrT+RJD8Rp/NrejTG2a+IhZZeeZC4Gm ShXXw00T8GTD4DhrmrIkBWHsOiMS2ABFpP/oO6+3xP+Ug0IAxFCeZY6p+4Sl+RUANFl5 Jg0g== X-Gm-Message-State: AOJu0YymLECoT15jerGsdTMgaUR/R2gArJ49tFy752Iquq8KOEdqPjFe ulq6+W6yEcWIN1smbuze3XrVvHolWQt3jg0oZ9n25tKYU74o9i01ZvZqS5M/nw== X-Google-Smtp-Source: AGHT+IHJbeFJRj2af/TeVk7CT045xF8z205MfKsnHz8Zv+T5k8Zf/8JpMLmo5m4WT4H0cCSu665ihg== X-Received: by 2002:a05:6a21:1394:b0:19e:9a75:7851 with SMTP id oa20-20020a056a21139400b0019e9a757851mr11160961pzb.3.1707789690254; Mon, 12 Feb 2024 18:01:30 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWShQoAxc8JTPJW9ZxxWQ50gFPFjeKhRSrhathoNDNWQLxf9RF3VXdMRpuSXGD/ghaXUlEcQQ43oERPJ4y1Do5GyTxK84IsYL4+F0Iz46nD3ByHbwCBqrzRJQpM+HfCKScrIjz/0a9yZYjvAysMn9ymPzG+EgB+VUbaW8TCBjEA Received: from [172.18.10.46] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id f12-20020a056a00238c00b006e0f160da2csm912939pfc.57.2024.02.12.18.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 18:01:29 -0800 (PST) Message-ID: <2692039df6b0cac20c5e488fa0209e8958c5fedb.camel@j-davis.com> Subject: Re: Built-in CTYPE provider From: Jeff Davis To: Peter Eisentraut , Daniel Verite Cc: Robert Haas , Jeremy Schneider , pgsql-hackers@postgresql.org Date: Mon, 12 Feb 2024 18:01:29 -0800 In-Reply-To: <612987b5-38fa-44c6-8b78-c0be5a177a70@eisentraut.org> References: <6f3e94c0-f174-4380-9b69-072f8a838881@manitou-mail.org> <12e4f6a78403b33c303c20e44976f891d879be09.camel@j-davis.com> <612987b5-38fa-44c6-8b78-c0be5a177a70@eisentraut.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2024-02-07 at 10:53 +0100, Peter Eisentraut wrote: > Various comments are updated to include the term "character class".=C2=A0 > I=20 > don't recognize that as an official Unicode term.=C2=A0 There are > categories=20 > and properties.=C2=A0 Let's check this. It's based on https://www.unicode.org/reports/tr18/#Compatibility_Properties so I suppose the right name is "properties". > Is it potentially confusing that only some pg_u_prop_* have a posix > variant?=C2=A0 Would it be better for a consistent interface to have a > "posix" argument for each and just ignore it if not used?=C2=A0 Not sure. I thought about it but didn't see a clear advantage one way or another. > About this initdb --builtin-locale option and analogous options=20 > elsewhere:=C2=A0 Maybe we should flip this around and provide a --libc- > locale=20 > option, and have all the other providers just use the --locale > option.=20 > This would be more consistent with the fact that it's libc that is=20 > special in this context. Would --libc-locale affect all the environment variables or just LC_CTYPE/LC_COLLATE? How do we avoid breakage? I like the general direction here but we might need to phase in the option or come up with a new name. Suggestions welcome. > Do we even need the "C" locale?=C2=A0 We have established that "C.UTF-8" > is=20 > useful, but if that is easily available, who would need "C"? I don't think we should encourage its use generally but I also don't think it will disappear any time soon. Some people will want it on simplicity grounds. I hope fewer people will use "C" when we have a better builtin option. > Some changes in this patch appear to be just straight renamings, like > in > src/backend/utils/init/postinit.c and=20 > src/bin/pg_upgrade/t/002_pg_upgrade.pl.=C2=A0 Maybe those should be put > into=20 > the previous patch instead. >=20 > On the collation naming: My expectation would have been that the=20 > "C.UTF-8" locale would be exposed as the UCS_BASIC collation. I'd like that. We have to sort out a couple things first, though: 1. The SQL spec mentions the capitalization of "=C3=9F" as "SS" specifically. Should UCS_BASIC use the unconditional mappings in SpecialCasing.txt? I already have some code to do that (not posted yet). 2. Should UCS_BASIC use the "POSIX" or "Standard" variant of regex properties? (The main difference seems to be whether symbols get treated as punctuation or not.) 3. What do we do about potential breakage for existing users of UCS_BASIC who might be expecting C-like behavior? Regards, Jeff Davis