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 1sNgFr-009yek-Ik for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Jun 2024 22:09:11 +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 1sNgFo-00Ao3n-Va for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Jun 2024 22:09:09 +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 1sNgFo-00Ao3e-Ea for pgsql-hackers@lists.postgresql.org; Sat, 29 Jun 2024 22:09:08 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sNgFh-003li1-II for pgsql-hackers@postgresql.org; Sat, 29 Jun 2024 22:09:07 +0000 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-700cc97b220so863245a34.0 for ; Sat, 29 Jun 2024 15:09:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1719698940; x=1720303740; darn=postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ZVGULScOuu+h5rS4d82Zc+5UuH9l1j3IrURAeBHdQYQ=; b=B99O42ww3RzibfosqSOiyze8ZQSDZY/jhuPo3hjzWtAX8cRj3IbodmwXX1+IW6NCcB dAjIcrPrv6mbV7O8Gd299BtACTeEfDCHTYBF3jl7GIK4sfBZmvurhoydJWggQfqei45c jR+jpnNJQCZ1V3POhPsuVMZRPmhYYb3m2al28= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719698940; x=1720303740; h=user-agent:in-reply-to: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=ZVGULScOuu+h5rS4d82Zc+5UuH9l1j3IrURAeBHdQYQ=; b=FhyfyTo/DcH0l3jZbGUDlL92SMrNVcwvO356Yihl7/84o4y7TGNmR7IPtzPjYsVoaZ 3gsKMz9tV+xevpyRPEH//kZ+JBMn8HShiyJbdnOzMk2yRpDBR24TRvH6D4pGpPQnZoYI 1ckK/AJCSM43n3lNPGd+FqSiTq01e7ZTgSOyLrHoOIJaAZjicjHeYghGBcJ+lN4z32xu lpx3i+SqlZs9+lKkhz3KDijgLFb+TPF7YZXpLmRemmXUX3ncb3/GdYnIyv8rC5C2hbEF ECMdgw8xwSJWW5vG8tIYAVCW/hsp+usrwUIMxRgHfskq2JNAocJam3/k4qiS6pNE7Wv+ nZBA== X-Forwarded-Encrypted: i=1; AJvYcCXPBEkI4rB04kFkom1R7PcN/D8z7Pc6JGbket+vSZiAxmnyl+W2WYzqbJ0w/IAQav5PbJTWVkFhSlfX4rCKPywrLGxmrwl0w2mGTFQG X-Gm-Message-State: AOJu0Yz1ktQBqruwRM0u9tQuQmKd6PIL6gndaDPbYtYM9IiDsSGuMOgo dMXl66k6wdDzn9vgFiOvRqRr4Vge7Ax+HyA3hqtgnYCgF8PM4mEVCXxJM3ILqg== X-Google-Smtp-Source: AGHT+IETItuEN4HFZcBNDY9Lxm7rglwSWodxV5wu8mzB17X3ThFcnGjYdr8SNEoWaSl8POPYQYOU3Q== X-Received: by 2002:a9d:6390:0:b0:702:351:cc6d with SMTP id 46e09a7af769-70207774332mr1331607a34.36.1719698940188; Sat, 29 Jun 2024 15:09:00 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-701f7b41e63sm794793a34.80.2024.06.29.15.08.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Jun 2024 15:08:59 -0700 (PDT) Date: Sat, 29 Jun 2024 15:08:57 -0700 From: Noah Misch To: Jeff Davis Cc: Peter Eisentraut , Daniel Verite , Robert Haas , Jeremy Schneider , pgsql-hackers@postgresql.org Subject: Re: Built-in CTYPE provider Message-ID: <20240629220857.fb.nmisch@google.com> References: <3bc653b5d562ae9e2838b11cb696816c328a489a.camel@j-davis.com> <163f4e2190cdf67f67016044e503c5004547e5a9.camel@j-davis.com> <6bdb98e68b2b05aa71f7f934e227738eac84ecee.camel@j-davis.com> <19b34a70-f5cf-4faf-88dc-917db44ed48d@eisentraut.org> <846a7e1fa2024918b58ff7583523a2f3de9a11b4.camel@j-davis.com> <3117d30aa911b408b90420f4f280fa0c3b5851be.camel@j-davis.com> <4135cf11-206d-40ed-96c0-9363c1232379@eisentraut.org> <7451f81ba0cb512222ab759de8ca1cffe44e9acb.camel@j-davis.com> <1f309153-8198-4efa-86dd-8c304ec0040c@eisentraut.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Wed, Mar 20, 2024 at 05:13:26PM -0700, Jeff Davis wrote: > On Tue, 2024-03-19 at 13:41 +0100, Peter Eisentraut wrote: > > * v25-0002-Support-C.UTF-8-locale-in-the-new-builtin-collat.patch > > > > Looks ok. > > Committed. > > + pg_c_utf8 > + > + > + This collation sorts by Unicode code point values rather than natural > + language order. For the functions lower, > + initcap, and upper, it uses > + Unicode simple case mapping. For pattern matching (including regular > + expressions), it uses the POSIX Compatible variant of Unicode + url="https://www.unicode.org/reports/tr18/#Compatibility_Properties">Compatibility > + Properties. Behavior is efficient and stable within a > + Postgres major version. This collation is > + only available for encoding UTF8. > + > + > + lower(), initcap(), upper(), and regexp_matches() are PROVOLATILE_IMMUTABLE. Until now, we've delegated that responsibility to the user. The user is supposed to somehow never update libc or ICU in a way that changes outcomes from these functions. Now that postgresql.org is taking that responsibility for builtin C.UTF-8, how should we govern it? I think the above text and [1] convey that we'll update the Unicode data between major versions, making functions like lower() effectively STABLE. Is that right? (This thread had some discussion[2] that datcollversion/collversion won't necessarily change when a major versions changes lower() behavior.) [1] https://postgr.es/m/7089acb3ebac0c1682a79c8bc16803cf06896fb9.camel@j-davis.com [2] https://postgr.es/m/5a1ecc40539f36cac5b27a62739a45a49785ca54.camel@j-davis.com