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 1u5PlT-00HW36-Pa for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Apr 2025 13:58:52 +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 1u5PlR-008cTz-BO for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Apr 2025 13:58:50 +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 1u5PlQ-008cTf-Oh for pgsql-hackers@lists.postgresql.org; Thu, 17 Apr 2025 13:58:49 +0000 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u5PlN-000Zws-30 for pgsql-hackers@postgresql.org; Thu, 17 Apr 2025 13:58:49 +0000 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-72c3b863b8eso470165a34.2 for ; Thu, 17 Apr 2025 06:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1744898325; x=1745503125; darn=postgresql.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0o+Yvpf3y4nBONASbECe9JWlZMT55eV9bMr5PR1slLs=; b=a90Pb+hSL+hw+yIvVpZdYavRx4d8VmbtmKr8aXDBM7/3kszHJkkRpuGAV8bLQRin4V ckIRiU50QkOVNKIdjZ0QWqpXcQaTi0H23ySvbNUApgXxx7SRgjXkkGfvwe7XQCvALSoH ZBQUJe5sfDa7Hm6sYDh5AkbZxBFm9huPUG4fo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744898325; x=1745503125; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0o+Yvpf3y4nBONASbECe9JWlZMT55eV9bMr5PR1slLs=; b=gX9Xt8peVwiH5hReQb9WnoQ1a7rIDOvCE/L5Trc8VvjapxwHfhAEbGlLAznXKGF0YM 1Src7x40gxzRHQ3zLuXYTU84X5kvv4TQtYjuglC6mlYt2asfzJAjoKA9bjuGUNJMNLd7 j+/IqWELGtnuVzzrHipOg95Uv6Lbbto1e7rH10oxvYl4juUbuoBvhEMeUSiRGb2iEqAq 8ifbl8giZFSW7JoTRjRV4D2+TNodiQE5ApVHje04IiR/UtVAFgoPINjzjU/R7yF5RHpr l1b7RZ2TM49wGqAYqmz0Zq9wIaWJLUaH+sS0mV5hZ3E2oCGYLdU+kTB8mEYUXvqQM/pj RFdA== X-Gm-Message-State: AOJu0YzgMxGYP9/gBusZfIqcDtGXFP/ZBZwT6+BlUQ+yokcW2WD43foh IIQc3Gy1CRopR9B1ZyM40H3Gha6VF1YVlYNTbKAQWt0V5GcE1zkEh/fEf6nhEXt77gLHfsFxgo0 = X-Gm-Gg: ASbGncvqwjn+mRJSiRzWqH+UW06WmeGiKpm99Pe8TJMBP1ilUP8OoRqpdmsftY8LWjs r0qsWgods2EIl0iAND+mqIoXAV7cBGE/the1PqcXGPYH+eBmKqOY0VyNW5F1kle3BUgJ56yoWHv oSNnDVhw+KggXKL+NSm9W/zeWADaBo5Ev62catvKW46Ont0L3zZGfV0uKXxBUYjviTE75smoQkR fc2k5RBj40VTU5wugIkNOXEE79EieqSBGi0gadwRczVUzTsFhojWPfGnnKLqgXrrf2E6Jt7Z5Q1 R4CkkVUBQdhyu2QOZ1g+K5932JDMR7cVU3GtNg== X-Google-Smtp-Source: AGHT+IHmrP1dZkSJReZrqaGdmSxtH7Z8zqisqzBTLRCihndV3atmRJIhr4R+InRVdyRXW7zWVQ+Q4w== X-Received: by 2002:a05:6830:63ce:b0:72b:a06b:dd71 with SMTP id 46e09a7af769-72ec6b947bamr4051808a34.5.1744898324731; Thu, 17 Apr 2025 06:58:44 -0700 (PDT) Received: from google.com ([2601:647:5600:80d0::31cd]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-604a5c4bdb4sm815451eaf.27.2025.04.17.06.58.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Apr 2025 06:58:43 -0700 (PDT) Date: Thu, 17 Apr 2025 06:58:41 -0700 From: Noah Misch To: Jeff Davis Cc: pgsql-hackers@postgresql.org Subject: Re: Unicode full case mapping: PG_UNICODE_FAST, and standard-compliant UCS_BASIC Message-ID: <20250417135841.33.nmisch@google.com> References: <179d2b9eb62ce9584177f4c863174c94de9985b7.camel@j-davis.com> <548f78d50590dfa119b21128c30c8ded5ce7e69d.camel@j-davis.com> <03d1416a974f7349b2415e01e85aac943fc55ba8.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jan 17, 2025 at 04:06:20PM -0800, Jeff Davis wrote: > Committed 0001 and 0002. > Upon reviewing the discussion threads, I removed the Unicode "adjust to > Cased" behavior when titlecasing. As Peter pointed out[1], it doesn't > match the documentation or expectations for INITCAP(). While commit d3d0983 changed most of the non-test pg_u_*() "bool posix" arguments, it left a pg_u_isalnum(u, true) in strtitle_builtin() subroutine initcap_wbnext(). The above paragraph may or may not be saying that's intentional. Example of the consequence at non-ASCII decimal digits: SELECT str, re, regexp_count(str COLLATE pg_c_utf8, re) AS count_c_utf8, regexp_count(str COLLATE pg_unicode_fast, re) AS count_unicode_fast, regexp_count(str COLLATE unicode, re) AS count_unicode, initcap(str COLLATE pg_c_utf8) AS initcap_c_utf8, initcap(str COLLATE pg_unicode_fast) AS initcap_unicode_fast, initcap(str COLLATE unicode) AS initcap_unicode FROM (VALUES (U&'foo\0661bar baz')) AS str_t(str), (VALUES ('[[:digit:]]')) AS re_t(re) ORDER BY 1, 2; str │ foo١bar baz re │ [[:digit:]] count_c_utf8 │ 0 count_unicode_fast │ 1 count_unicode │ 1 initcap_c_utf8 │ Foo١Bar Baz initcap_unicode_fast │ Foo١Bar Baz initcap_unicode │ Foo١bar Baz Should initcap_wbnext() pass in a locale-dependent "bool posix" argument like the others calls the commit changed? Related message from the development of pg_c_utf8, which you shared downthread: https://www.postgresql.org/message-id/610d7f1b-c68c-4eb8-a03d-1515da304c58%40manitou-mail.org Long-term, pg_u_isword() should have a "bool posix" argument. Currently, only tests call that function. If it got a non-test caller, https://www.unicode.org/reports/tr18/#word would have pg_u_isword() follow the choice of posix compatibility like pg_u_isalnum() does.