pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: James Lucas <jlucasdba@gmail.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Subject: Re: Explicit deterministic COLLATE fails with pattern matching operations on column with non-deterministic collation
Date: Thu, 28 May 2020 14:29:28 -0400
Message-ID: <7417.1590690568@sss.pgh.pa.us> (raw)
In-Reply-To: <CAAFmbbPn6B+jMJ-DTkMnNoKkJtgx_QTDpL-KqXKsGjsFA0936w@mail.gmail.com>
References: <CAAFmbbOvfi=wMM=3qRsPunBSLb8BFREno2oOzSBS=mzfLPKABw@mail.gmail.com>
	<CAKFQuwZakFfXX3m5K5oMg9WJgQT6FffLRjYQzJQgTH1pGOOz5Q@mail.gmail.com>
	<CAAFmbbN6iY-g4Of4k5S7t52Cvcvk_bO=SxZOySa6F4pR01eUTw@mail.gmail.com>
	<5075.1590625286@sss.pgh.pa.us>
	<CAAFmbbPn6B+jMJ-DTkMnNoKkJtgx_QTDpL-KqXKsGjsFA0936w@mail.gmail.com>

James Lucas <jlucasdba@gmail.com> writes:
> I tried setting up a pathological test case for this, and it seems
> like at least currently, even with a non-deterministic collation
> statistics still count values as distinct, even if the default
> collation would consider them equivalent.  Not sure if that's as
> intended or not?

I experimented with this, and what I'm seeing is that ucol_strcollUTF8()
reports that 'aaa' is different from 'aAa'.  So the behavior on the
Postgres side is as-expected.  I suspect that the 'en-US-ks-level2'
ICU locale doesn't act as you think it does.  (That is, just saying
that a collation is nondeterministic doesn't make it so; it only forces
Postgres through slower code paths that allow for the possibility of
bitwise-unequal strings being reported as equal by ICU.)  Not knowing
anything about ICU, I can't say more than that.

[ Tested on libicu-60.3-2.el8_1 ]

			regards, tom lane





view thread (11+ messages)  latest in thread

Message-ID: <7417.1590690568@sss.pgh.pa.us>
Permalink:  ../7417.1590690568@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7417.1590690568@sss.pgh.pa.us

 · 

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: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jlucasdba@gmail.com, david.g.johnston@gmail.com, pgsql-bugs@lists.postgresql.org, peter.eisentraut@2ndquadrant.com
  Subject: Re: Explicit deterministic COLLATE fails with pattern matching operations on column with non-deterministic collation
  In-Reply-To: <7417.1590690568@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox