Re: SQL/JSON path: collation for comparisons, minor typos in docs

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Markus Winand <markus(dot)winand(at)winand(dot)at>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL/JSON path: collation for comparisons, minor typos in docs
Date: 2019-08-11 20:11:36
Message-ID: CAPpHfdvzzoVuAg_dC-1Pp3Wuqq9oKXaPSHeo+=ocAZNhH-v1oA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 9, 2019 at 5:27 PM Alexander Korotkov
<a(dot)korotkov(at)postgrespro(dot)ru> wrote:
> On Thu, Aug 8, 2019 at 11:30 PM Alexander Korotkov
> <a(dot)korotkov(at)postgrespro(dot)ru> wrote:
> > On Thu, Aug 8, 2019 at 11:53 AM Markus Winand <markus(dot)winand(at)winand(dot)at> wrote:
> > > The patch makes my tests pass.
> >
> > Cool.
> >
> > > I wonder about a few things:
> > >
> > > - Isn’t there any code that could be re-used for that (the one triggered by ‘a’ < ‘A’ COLLATE ucs_basic)?
> >
> > PostgreSQL supports ucs_basic, but it's alias to C collation and works
> > only for utf-8. Jsonpath code may work in different encodings. New
> > string comparison code can work in different encodings.
> >
> > > - For object key members, the standard also refers to unicode code point collation (SQL-2:2016 4.46.3, last paragraph).
> > > - I guess it also applies to the “starts with” predicate, but I cannot find this explicitly stated in the standard.
> >
> > For object keys we don't actually care about whether strings are less
> > or greater. We only search for equal keys. So, per-byte comparison
> > we currently use should be fine. The same states for "starts with"
> > predicate.
> >
> > > My tests check whether those cases do case-sensitive comparisons. With my default collation "en_US.UTF-8” I cannot discover potential issues there. I haven’t played around with nondeterministic ICU collations yet :(
> >
> > That's OK. There should be other beta testers around :)
>
> So, I'm going to push this if no objections.

So, pushed.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-08-11 20:37:55 Re: Table inheritance and column ordering question
Previous Message Tom Lane 2019-08-11 19:59:06 Re: Regression test failure in regression test temp.sql