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 1sQzIs-00Cjtl-P9 for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jul 2024 01:05:58 +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 1sQzIr-00BIDh-89 for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jul 2024 01:05:57 +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 1sQzIq-00BIDY-Up for pgsql-hackers@lists.postgresql.org; Tue, 09 Jul 2024 01:05:56 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sQzIj-0017bK-FU for pgsql-hackers@postgresql.org; Tue, 09 Jul 2024 01:05:55 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6f8d0a1e500so4186518a34.3 for ; Mon, 08 Jul 2024 18:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1720487149; x=1721091949; 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=KCYQHH1C4kTzAaAMfaCystYEkNd9nYxpf8F+nwTntHg=; b=Qiv9yw6MjpBsCSNYsaNRA9RWTwHhNa4+HC3+rcl0mxCno+/t/AKYa2o9FlIL8MM7dx rCjbWwqBbKGuBBK9g9XZjnqQQCac3RxnTnfgkcQkOb0ceAx2Mb4PD6Jlj3vdSoLXFwbO faMmwbyLGegL3+rPvCzXgKHYHFpAtTSP2+mLc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720487149; x=1721091949; 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=KCYQHH1C4kTzAaAMfaCystYEkNd9nYxpf8F+nwTntHg=; b=OViyYlAa9ehbtXpEQtGySz9QnIFAaxuruuTDGWzfS8bKVeZtGe6nSJX1JGHQ/67McK ypn4/sXIly1YmFlPzDEPoju5mL/7bgbKwMAEptS9tgAQ8MAxjVARoiC0bUNSosd0LVC4 /lF36NEENeJqikDo20gOzptn6yJExhShSTpJysyFTU4IsoJ/tl6d6e0gzQXzAcSDFcoN FuZZ9ZL7OE9QJmMoyrQ/EQTMnrB2jlWjCP+i4afdreQTUAXdclyZkIXVxk9giHbHPv/J 7IWhz+pXK+Gxpgrhl7OIgU4MMQEw4gjJQVgEVXdxYUqtcAvhdn506xLUEnyoAJ0/W0mI 2s3A== X-Forwarded-Encrypted: i=1; AJvYcCWqDGuwFyIgIJl9orlV+FRZZgpY64KcJGzjmuqwBeAz/ADYgBuRSd4WxQ2w1SN0OecrE7sV0iQiNWMEmAfeYbCPXAirIKqVsJL5Di0Y X-Gm-Message-State: AOJu0YzOSMuVjjXU4Rujgo0s06/mMMQhKH2gpdu4dz125D9USASHBE5/ +WS95ZOdPlWgOlbhX00mrzPV2n71YSQ98/YhlBpoJ/6EoX/Fxn78p1Oz/G5SFl9qa/4vSd9KXSc = X-Google-Smtp-Source: AGHT+IHtuhWZYEI8FjdntaUV+f+HrKYk0dqdYwG5DJM1tIS2XqVtu5YcnZp2nDYWpu1Sf2DGYeMrgA== X-Received: by 2002:a9d:6c07:0:b0:703:6aa3:d091 with SMTP id 46e09a7af769-703759faa83mr1169728a34.2.1720487148639; Mon, 08 Jul 2024 18:05:48 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70374f88385sm239226a34.35.2024.07.08.18.05.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jul 2024 18:05:48 -0700 (PDT) Date: Mon, 8 Jul 2024 18:05:45 -0700 From: Noah Misch To: Tom Lane Cc: Jeff Davis , Peter Eisentraut , Daniel Verite , Robert Haas , Jeremy Schneider , pgsql-hackers@postgresql.org Subject: Re: Built-in CTYPE provider Message-ID: <20240709010545.8c.nmisch@google.com> References: <20240701230352.2c.nmisch@google.com> <20240702165145.af.nmisch@google.com> <1200e97b-3a52-43c6-8b16-20cf45f58249@eisentraut.org> <20240702230333.8d.nmisch@google.com> <20240704212641.c4.nmisch@google.com> <1d178eb1bbd61da1bcfe4a11d6545e9cdcede1d1.camel@j-davis.com> <20240706195129.fd@rfd.leadboat.com> <564325.1720297161@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <564325.1720297161@sss.pgh.pa.us> 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 Sat, Jul 06, 2024 at 04:19:21PM -0400, Tom Lane wrote: > Noah Misch writes: > > As a released feature, NORMALIZE() has a different set of remedies to choose > > from, and I'm not proposing one. I may have sidetracked this thread by > > talking about remedies without an agreement that pg_c_utf8 has a problem. My > > question for the PostgreSQL maintainers is this: > > > textregexeq(... COLLATE pg_c_utf8, '[[:alpha:]]') and lower(), despite being > > IMMUTABLE, will change behavior in some major releases. pg_upgrade does not > > have a concept of IMMUTABLE functions changing, so index scans will return > > wrong query results after upgrade. Is it okay for v17 to release a > > pg_c_utf8 planned to behave that way when upgrading v17 to v18+? > > I do not think it is realistic to define "IMMUTABLE" as meaning that > the function will never change behavior until the heat death of the > universe. As a counterexample, we've not worried about applying > bug fixes or algorithm improvements that change the behavior of > "immutable" numeric computations. True. There's a continuum from "releases can change any IMMUTABLE function" to "index integrity always wins, even if a function is as wrong as 1+1=3". I'm less concerned about the recent "Incorrect results from numeric round" thread, even though it's proposing to back-patch. I'm thinking about these aggravating factors for $SUBJECT: - $SUBJECT is planning an annual cadence of this kind of change. - We already have ICU providing collation support for the same functions. Unlike $SUBJECT, ICU integration gives packagers control over when to accept corruption at pg_upgrade time. - SQL Server, DB2 and Oracle do their Unicode updates in a non-corrupting way. (See Jeremy Schneider's reply concerning DB2 and Oracle.) - lower() and regexp are more popular in index expressions than high-digit-count numeric calculations. > I'd say a realistic policy is "immutable means we don't intend to > change it within a major release". If we do change the behavior, > either as a bug fix or a major-release improvement, that should > be release-noted so that people know they have to rebuild dependent > indexes and matviews. It sounds like you're very comfortable with $SUBJECT proceeding in its current form. Is that right?