Re: BUG #14885: mistake in sorting win1251 chars

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Kalin Daskalov <k(dot)daskalov(dot)911(at)gmail(dot)com>
Cc: Francisco Olarte <folarte(at)peoplecall(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14885: mistake in sorting win1251 chars
Date: 2017-11-02 17:31:45
Message-ID: CAFj8pRBJ0TymK8RNTTDAij1ADZD92gHjqNK1EWsa_B64yaiwrQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

2017-11-02 18:27 GMT+01:00 Kalin Daskalov <k(dot)daskalov(dot)911(at)gmail(dot)com>:

> Hi,
> I understand you well and this exactly is the situation.
>
> "иa"
> "йa"
> "иb"
> "йb"
> "иc"
>
> I have to admit that this is not PostgreSQL problem.
>
> In fact my previous compares are based on ASCII comparison - based on the
> order of the chars.
> Now I test with ANSI comparison realized with MS Windows system functions
> and the result the same as in PostgreSQL.
>
> But this is not appropriate. In fact if Cyrillic alphabet these are
> different letters and in Bulgarian language no one does expect this
> behavior. It's almost like to decide that Latin letters "i" and "y" should
> have such behavior.
> Just the problem is elsewhere... And I have no decision.
>

what locales do you use? It should to work everywhere. For Czech language
we should to use Czech locale

regards

Pavel

> Regards,
> Kalin Daskalov
>
> On Thu, Nov 2, 2017 at 5:38 PM, Francisco Olarte <folarte(at)peoplecall(dot)com>
> wrote:
>
>> On Thu, Nov 2, 2017 at 10:57 AM, <k(dot)daskalov(dot)911(at)gmail(dot)com> wrote:
>> > Here is a small example:
>> > "АЙГЕР"
>> > "АИКО"
>> > "АЙКОН"
>>
>> Are you sure it's sorting badly? In some collations some letters sort
>> equally, you should try:
>>
>> "АИКО"
>> "АЙКОН"
>> and
>> "АИКОH"
>> "АЙКО"
>>
>> as "И" may be sorting in the same place as "Й" and it is deciding by the
>> tails.
>>
>> It happens in spanish with the tildes ( a and à sort in the same
>> place, so unless they are the only difference order depends on aht is
>> around:
>> test=> select * from ( values ('a'),('à'),('ay'),('àx'),('za'),('zà')
>> ) x order by 1;
>> column1
>> ---------
>> a
>> à
>> àx
>> ay
>> za
>> zà
>> (6 rows)
>> )
>>
>> Doing something like this with your alphabet may shed some light on the
>> issue.
>>
>> (note, this was done with locale en_US.utf-8 )
>>
>> Francisco Olarte.
>>
>
>
>
> --
> Kalin Daskalov,
> k(dot)daskalov(dot)911(at)gmail(dot)com
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Francisco Olarte 2017-11-03 07:22:25 Re: BUG #14885: mistake in sorting win1251 chars
Previous Message Kalin Daskalov 2017-11-02 17:27:43 Re: BUG #14885: mistake in sorting win1251 chars