BUG #19830: Mention that UNIQUE on a nondeterministic ICU collation treats ignorable characters as duplicates

Started by PG Bug reporting form19 days ago2 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 19830
Logged by: aswini kumar tummala
Email address: aswin.tummala@gmail.com
PostgreSQL version: 19rc1
Operating system: Windows, MacOs
Description:

Hi,

When migrating from SQL Server, we found that a UNIQUE constraint on a
column with und-u-ks-level2 (deterministic = false)
rejects 'ACME' || U&'\200B' as a duplicate of 'ACME'. The same data loads
fine into a citext column. Section 23.2.3.1 does show
U+2063 being ignored, but it doesn't say what that means for constraints.
A short note under "Nondeterministic Collations" would
have saved us time. It could say that ignorable code points (zero-width
space, soft hyphen, BOM, most control characters) don't
count toward uniqueness, and that this differs from citext.

Reproduced on 18.6 and 19 RC1.

Thanks,
Aswini Kumar Tummala

#2Peter Eisentraut
peter@eisentraut.org
In reply to: PG Bug reporting form (#1)
Re: BUG #19830: Mention that UNIQUE on a nondeterministic ICU collation treats ignorable characters as duplicates

On 04.11.26 02:43, PG Bug reporting form wrote:

When migrating from SQL Server, we found that a UNIQUE constraint on a
column with und-u-ks-level2 (deterministic = false)
rejects 'ACME' || U&'\200B' as a duplicate of 'ACME'. The same data loads
fine into a citext column. Section 23.2.3.1 does show
U+2063 being ignored, but it doesn't say what that means for constraints.
A short note under "Nondeterministic Collations" would
have saved us time. It could say that ignorable code points (zero-width
space, soft hyphen, BOM, most control characters) don't
count toward uniqueness, and that this differs from citext.

What you are observing is a very specific combination of several
features. It would be extremely niche and redundant to document this
particular case.

I would think that if you understand what nondeterministic collations
are (and you have chosen to use them) and you know what unique
constraints are, then this behavior would follow from that. We could
perhaps try to clarify this somehow, but it would have to be in more
general terms.