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 1rPSrS-00Blzq-E0 for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jan 2024 19:43:07 +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 1rPSrQ-00H5nw-Sm for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jan 2024 19:43:04 +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 1rPSrQ-00H5no-G4 for pgsql-hackers@lists.postgresql.org; Mon, 15 Jan 2024 19:43:04 +0000 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rPSrM-001yvU-E8 for pgsql-hackers@postgresql.org; Mon, 15 Jan 2024 19:43:03 +0000 Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-36082f3cb06so50855815ab.1 for ; Mon, 15 Jan 2024 11:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1705347777; x=1705952577; 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=etLkUy/n/dyl+CDbQnjG7HoT4EgOQlJ0w5q/r44/8K0=; b=lWOniAXF3WDQu5QNWwUGbdlv32gxMFmEU3eeCzmKn51RFrJrAkpWt+9vJ0ojJGuKTN bYTofZPns9VZBdcrNMiI6L3dv5dDr7se6CdAdF2x1XlUClC4sORrMZN9ye/xwsvQU0zv O2n1Qt3J3FyBUCXmLOnU/i1Y6DmzyMM9W7DANn2mFbi4p/9ht+C/TNwyVT8qb7j6vdNv 4wOdT1zwDffdrD2lFqXhGkVjefAb5PLN3lC5wk6c+XTfs60TCJT4n5df+jRp53IeD120 WRnrKY8kL5P8M1z01mdp+6XiI7/N8d/bJ6xN7EUykfwWjY/m69kaUEkB171bcIIrthF5 kHFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705347777; x=1705952577; 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=etLkUy/n/dyl+CDbQnjG7HoT4EgOQlJ0w5q/r44/8K0=; b=HEjwuNfvkZvArP5/m7lzvqJB1YyhlnYbhYOuvMRgaHFoydjz9V69552RFFn5wGplPS 2Uv++7HffRngzWD2BPhgAF6IW3y5MPyZKDQtfRJWFbmVkZn63kwNdBNK61CPxIl5BObh eZJivSJUMpP/iU+lKmXDlAmXaw+M3t5uIBK+By70+U8a5FXaOi75ZnK2grPgvtMqjtEd OfAXVD0TYtOljzb75D1KDszolAzMr7GcGwVEx5bgIKBWehKDPwpTm0QDglokP1nEM/Vd 3fdVpF/ec2Nk6WZTkCHe3zp3kc7yQq9pUbq1OmKW6nwvYGQDgG1cKcTOa8TALF7x9PZf QpSA== X-Gm-Message-State: AOJu0YzYO28Upz3YsKX/K+hKKwpMpnGh7sv6WPfBOt3tFDpV35P+foaY ps8qvyjobX2gc4UylJHOztICjcTmSca9 X-Google-Smtp-Source: AGHT+IFxq5gq1P408MMxKM20CFGX6wTirvWwAed/mM3OACSWQ6Mc0eeVQUall79g1kC+LPxb9d3AvQ== X-Received: by 2002:a92:c60e:0:b0:360:17a8:5c7d with SMTP id p14-20020a92c60e000000b0036017a85c7dmr7817172ilm.6.1705347777565; Mon, 15 Jan 2024 11:42:57 -0800 (PST) Received: from [172.18.10.36] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id bw39-20020a056a0204a700b005c66b54476bsm7399567pgb.63.2024.01.15.11.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 11:42:57 -0800 (PST) Message-ID: <7089acb3ebac0c1682a79c8bc16803cf06896fb9.camel@j-davis.com> Subject: Re: Built-in CTYPE provider From: Jeff Davis To: Daniel Verite Cc: Robert Haas , Jeremy Schneider , pgsql-hackers@postgresql.org Date: Mon, 15 Jan 2024 11:42:56 -0800 In-Reply-To: References: 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 Mon, 2024-01-15 at 15:30 +0100, Daniel Verite wrote: > Concerning the target category_test, it produces failures with > versions of ICU with Unicode < 15. The first one I see with Ubuntu > 22.04 (ICU 70.1) is: ... > I find these results interesting because they tell us what contents > can break regexp-based check constraints on upgrades. Thank you for collecting and consolidating this information. > But about category_test as a pass-or-fail kind of test, it can only > be > used when the Unicode version in ICU is the same as in Postgres. The test has a few potential purposes: 1. To see if there is some error in parsing the Unicode files and building the arrays in the .h file. For instance, let's say the perl parser I wrote works fine on the Unicode 15.1 data file, but does something wrong on the 16.0 data file: the test would fail and we'd investigate. This is the most important reason for the test. 2. To notice any quirks between how we interpret Unicode vs how ICU does. 3. To help see "interesting" differences between different Unicode versions. For #1 and #2, the best way to test is by using a version of ICU that uses the same Unicode version as Postgres. The one running update- unicode can try to recompile with the right one for the purposes of the test. NB: There might be no version of ICU where the Unicode version exactly matches what we'd like to update to. In that case, we'd need to use the closest version and do some manual validation that the generated tables are sane. For #3, that is also interesting information to know about, but it's not directly actionable. As you point out, Unicode does not guarantee that these properties are static forever, so regexes can change behavior when we update Unicode for the next PG version. That is a much lower risk than a collation change, but as you point out, is a risk for regexes inside of a CHECK constraint. If a user needs zero risk of semantic changes for regexes, the only option is "C". Perhaps there should be a separate test target for this mode so that it doesn't exit early? (Note: case mapping has much stronger guarantees than the character classification.) I will update the README to document how someone running update-unicode should interpret the test results. Regards, Jeff Davis