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

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: SQL/JSON path: collation for comparisons, minor typos in docs
Дата
Msg-id CAPpHfdsJv7kmLGWgu7n23xLXtW=5fAYwUxhobrTqFbG_eQaW6g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: SQL/JSON path: collation for comparisons, minor typos in docs  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Ответы Re: SQL/JSON path: collation for comparisons, minor typos in docs  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Список pgsql-hackers
On Wed, Aug 7, 2019 at 4:11 PM Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
> On Wed, Aug 7, 2019 at 2:25 PM Markus Winand <markus.winand@winand.at> wrote:
> > I was playing around with JSON path quite a bit and might have found one case where the current implementation
doesn’tfollow the standard. 
> >
> > The functionality in question are the comparison operators except ==. They use the database default collation
ratherthen the standard-mandated "Unicode codepoint collation” (SQL-2:2016 9.39 General Rule 12 c iii 2 D, last
sentencein first paragraph). 
>
> Thank you for pointing!  Nikita is about to write a patch fixing that.

Please, see the attached patch.

Our idea is to not sacrifice "==" operator performance for standard
conformance.  So, "==" remains per-byte comparison.  For consistency
in other operators we compare code points first, then do per-byte
comparison.  In some edge cases, when same Unicode codepoints have
different binary representations in database encoding, this behavior
diverges standard.  In future we can implement strict standard
conformance by normalization of input JSON strings.

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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Documentation clarification re: ANALYZE
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Documentation clarification re: ANALYZE