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 1qYV8O-001tQM-Et for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Aug 2023 17:25:40 +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 1qYV8M-003HfE-N9 for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Aug 2023 17:25:38 +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 1qYV8M-003Hf6-7d for pgsql-hackers@lists.postgresql.org; Tue, 22 Aug 2023 17:25:38 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qYV8H-000PHI-63 for pgsql-hackers@postgresql.org; Tue, 22 Aug 2023 17:25:37 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1bf7a6509deso16031535ad.3 for ; Tue, 22 Aug 2023 10:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20221208.gappssmtp.com; s=20221208; t=1692725130; x=1693329930; 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=xIUN+vnVh54OAV7rviYD2v+fXCSqJk1GqplgZ4o2z6s=; b=G9GYjZe5pSFd3pxWsRQh61+aQLUhRLibp440zseUxg6D/5ZJOkXsOzGjxXEp5W4aEx Zbs1K1hSJOjsxwSFBHyKMM+S5jumtBCg/ntpWabIwlJsdNl8mriDsXctBMX68ixx8mjX SiiRuQMhxlg3f1DvWAToY71EbSPX39Gt5XoZScpT7FaCuX5L6id1w/yspT7D1gAMo9Ok 4j0LlAMhOCDnxGDACFOnlikcAsZsI22BtDp1UOZC1mqjLNxS8XEKK8oKutmNMw5CsQTx 9CByKy/WYNYOqzbUkkOARs08KKf/cvy+/OJTzbNOHxSL6jIh50aso4WH/LZGKgz5kXnW bP0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692725130; x=1693329930; 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=xIUN+vnVh54OAV7rviYD2v+fXCSqJk1GqplgZ4o2z6s=; b=Qh3qO7eg7fqRPHyvQ+yp8NS3wDJenJdVBaDR9Ow+ACfYchaOtL2IpomoXBrXc5bA2W mF79wEY3HJ36jH4Z5SjJglVJqJU4nbQeQN3/uDvDOd62ypOtIz8ACGfwocNcBcQHukVW b6uL5TF5uGdULLIIJqhwttlTUBrwg3UEORinGSxfsfOEqiSa96wcJ2/tVZM6e+u6F3jz Le+/WTWugWpx12XXMl1fswnLoKvp6n9hDo7J4LB4gNEKAuXBXn/8d8l8EslcHXH/eQX0 JInm/42OAHq2vjX60IgNUMOeUAoxWXYEss+BK9mYjAk8oSkD6IxUnz3L+Cr+ZG9fim+L qNGQ== X-Gm-Message-State: AOJu0YyMsVbGWmAnzLyi9nJ3qarzuormVnpcCWEb6k9+TfasdZmC+9Vq 73p4m75zo7izvnEmf6rW8KwuFA== X-Google-Smtp-Source: AGHT+IFPmas9mlZBGC/M7nh+Si6dPsbUki3x0p7jtXELRSo6r/BoWZ9dEA2BoNYmfFF74TSJZONWEg== X-Received: by 2002:a17:90b:1911:b0:26d:2b42:cdae with SMTP id mp17-20020a17090b191100b0026d2b42cdaemr6727733pjb.3.1692725129639; Tue, 22 Aug 2023 10:25:29 -0700 (PDT) Received: from [172.24.1.77] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id a3-20020a17090a740300b0026b3a86b0d5sm8090977pjg.33.2023.08.22.10.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 10:25:29 -0700 (PDT) Message-ID: <0aa4f0301450f75b4a57a17bb4d652aee99eeb41.camel@j-davis.com> Subject: Re: pgsql: Allow tailoring of ICU locales with custom rules From: Jeff Davis To: Peter Eisentraut , pgsql-hackers Cc: Amit Kapila Date: Tue, 22 Aug 2023 10:25:29 -0700 In-Reply-To: References: <36a6e89689716c2ca1fae8adc8e84601a041121c.camel@j-davis.com> 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, 2023-08-14 at 10:34 +0200, Peter Eisentraut wrote: > I have investigated this.=C2=A0 My assessment is that how PostgreSQL=20 > interfaces with ICU is correct.=C2=A0 Whether what ICU does is correct > might=20 > be debatable.=C2=A0 I have filed a bug with ICU about this:=20 > https://unicode-org.atlassian.net/browse/ICU-22456=C2=A0, but there is no= =20 > response yet. Is everything other than the language and region simply discarded when a rules string is present, or are some attributes preserved, or is there some other nuance? > You can work around this by including the desired attributes in the=20 > rules string, for example >=20 > =C2=A0=C2=A0=C2=A0=C2=A0 create collation c3 (provider=3Dicu, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 locale=3D'und-u-ka-shifted-ks-level1= ', > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rules=3D'[alternate shifted][strengt= h 1]', > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 deterministic=3Dfalse); >=20 > So I don't think there is anything we need to do here for PostgreSQL > 16. Is there some way we can warn a user that some attributes will be discarded, or improve the documentation? Letting the user figure this out for themselves doesn't seem right. Are you sure we want to allow rules for the database default collation in 16, or should we start with just allowing them in CREATE COLLATION and then expand to the database default collation later? I'm still a bit concerned about users getting too fancy with daticurules, and ending up not being able to connect to their database anymore. Regards, Jeff Davis