public inbox for [email protected]
help / color / mirror / Atom feedFrom: PG Bug reporting form <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: BUG #19425: Parametric settings in collation not working in rule syntax
Date: Wed, 04 Mar 2026 08:43:13 +0000
Message-ID: <[email protected]> (raw)
The following bug has been logged on the website:
Bug reference: 19425
Logged by: Dorian
Email address: [email protected]
PostgreSQL version: 18.3
Operating system: Windows
Description:
Hello,
I want to create a custom collation with settings and tailoring rules, but I
ran into an issue.
When I create a custom collation, I first used collation settings in the
local, giving me something like this :
CREATE COLLATION IF NOT EXISTS und_ci_ai1(
provider = icu,
locale = 'und-u-ka-shifted-kc-false-ks-level1',
deterministic = false
);
For instance, I can do this request and I will get the result '1' :
SELECT 1 WHERE 'adm' LIKE 'Adm' COLLATE und_ci_ai1;
But, I also want to add a tailoring rule. For the simplicity we will say
that I want to add 'p < q'
CREATE COLLATION IF NOT EXISTS und_ci_ai2(
provider = icu,
locale = 'und-u-ka-shifted-kc-false-ks-level1',
deterministic = false,
rules = $$
& 'p' < 'q'
$$
);
But, and this is my problem, the previous request doesn't seem to work
anymore. It doesn't return '1' :
SELECT 1 WHERE 'adm' LIKE 'Adm' COLLATE und_ci_ai2;
For this request to return '1', I have to add 'a' = 'A' like this :
rules = $$
& 'p' < 'q'
& 'a' = 'A'
$$
I didn't see in the documentation that I can't use settings in locale AND
tailoring rules at the same time. But just in case I tried to use parametric
settings in the rules syntax.
Unfortunately, it doesn't seem to work at all, the request still doesn't
return '1' :
CREATE COLLATION IF NOT EXISTS und_ci_ai3(
provider = icu,
locale = 'und',
deterministic = false,
rules = $$
[strength 1]
[caseLevel off]
$$
);
SELECT 1 WHERE 'adm' LIKE 'Adm' COLLATE und_ci_ai3;
I hope I gave you all the infos you need. Thank you for your time.
Here the documentations I used :
https://www.postgresql.org/docs/current/collation.html#ICU-COLLATION-SETTINGS
https://www.unicode.org/reports/tr35/tr35-collation.html#Setting_Options
https://unicode-org.github.io/icu/userguide/collation/customization/
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: BUG #19425: Parametric settings in collation not working in rule syntax
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox