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 1sOQ43-00E9lH-5J for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jul 2024 23:04:03 +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 1sOQ3z-004WZY-S4 for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jul 2024 23:04:00 +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 1sOQ3z-004WZQ-8p for pgsql-hackers@lists.postgresql.org; Mon, 01 Jul 2024 23:03:59 +0000 Received: from mail-yw1-x1132.google.com ([2607:f8b0:4864:20::1132]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sOQ3x-004ZOy-2T for pgsql-hackers@postgresql.org; Mon, 01 Jul 2024 23:03:58 +0000 Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-63bc513ade5so29209627b3.3 for ; Mon, 01 Jul 2024 16:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1719875035; x=1720479835; 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=kUyiqPHYblxPRfLOvEwn1rx7g1mt8Mcc8MTv+Ep9Hnc=; b=LdP4B1clLH5/k+2nT+0SXnXPN0XPeqvkAX5L0GYlGLNVldw15XYFzp6bXKgm4BKh1B XdzAYIVtm5GIcfOMZM7bJu5r/hS6XhcS74/bkSn+frOHFZnCaE8uLrgZdX5iucO1ctkF UOs1TmRbCg0etZJjC8k73hsYOPKFNJ7QJtmjE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719875035; x=1720479835; 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=kUyiqPHYblxPRfLOvEwn1rx7g1mt8Mcc8MTv+Ep9Hnc=; b=GPHRLpfFq66i2GCn/BbtWy/dq5IgJaM0nuE7lsrX+5qJrmsDr7GTQXlu2IgK6/TvMl JSSVBbQZIB+uoaHHj8Dz2jdaEsWJD7+CLxnOWiDVpqpAw8z3XBwkES8bHp74ZJ5kw4/f JsGdP+QLcfXLui69hqQGZ6W9un6hmcf+7B7JmV7bmX5e0olK1xSmwD0rXtCBuXdozWxG XLL/skilj/ab6lVaOHFhEIS9a3VbZAOuBzA698SXRvFfAX+tbW7R+TgJd+yb7iTdR/vg Q7msz/Hhzw+B3S6jURsXlCepT17WH1pZ6THVdJX12MrTaXE+DW40NQR9pvKL/yioLGpd qfjg== X-Forwarded-Encrypted: i=1; AJvYcCULme7+BVOrat9Mor5NSZvjtXW532Dkhnj4qBOqHfLhFph21Gk/Hpt0rps2ln7WCSztxI2yTEwFjhOg9v60M8RsaIIZ2CLxwWRf8MfI X-Gm-Message-State: AOJu0YyniDdRgpUpXG03lRgEhtTyp9qikP0sj8qPfdQ8sYLBx719jzxx OKdsMC2j3PN16wLfix6yilQV5uMuXyeNL8yRByHfyzOPMMxCDq0Di5XANPNWsQ== X-Google-Smtp-Source: AGHT+IEVNEh1BktPclyaK1YIDD4XZYEudeOXefumeQG3QrkuL49VNk7Yu1K81NuzzpiMn0UzIZ6q7Q== X-Received: by 2002:a0d:fd84:0:b0:64a:4de1:8669 with SMTP id 00721157ae682-64c75121df2mr63996957b3.52.1719875035099; Mon, 01 Jul 2024 16:03:55 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 00721157ae682-64a99e5c78dsm15343847b3.20.2024.07.01.16.03.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jul 2024 16:03:54 -0700 (PDT) Date: Mon, 1 Jul 2024 16:03:52 -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: <20240701230352.2c.nmisch@google.com> References: <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> <20240629220857.fb.nmisch@google.com> <1ecfeb4d2b1b7f119fa917d3052a3aecfaf4f425.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1ecfeb4d2b1b7f119fa917d3052a3aecfaf4f425.camel@j-davis.com> 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 Mon, Jul 01, 2024 at 12:24:15PM -0700, Jeff Davis wrote: > On Sat, 2024-06-29 at 15:08 -0700, Noah Misch wrote: > > 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. > > To me, "delegated" connotes a clear and organized transfer of > responsibility to the right person to solve it. In that sense, I > disagree that we've delegated it. Good point. > >   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? > > Marking them STABLE is not a viable option, that would break a lot of > valid use cases, e.g. an index on LOWER(). I agree. > I don't think we need code changes for 17. Some documentation changes > might be helpful, though. Should we have a note around LOWER()/UPPER() > that users should REINDEX any dependent indexes when the provider is > updated? I agree the v17 code is fine. Today, a user can (with difficulty) choose dependency libraries so regexp_matches() is IMMUTABLE, as marked. I don't want $SUBJECT to be the ctype that, at some post-v17 version, can't achieve that with unpatched PostgreSQL. Let's change the documentation to say this provider uses a particular snapshot of Unicode data, taken around PostgreSQL 17. We plan never to change that data, so IMMUTABLE functions can rely on the data. If we provide a newer Unicode data set in the future, we'll provide it in such a way that DDL must elect the new data. How well would that suit your vision for this feature? An alternative would be to make pg_upgrade reject operating on a cluster that contains use of $SUBJECT.