Re: BUG #14885: mistake in sorting win1251 chars

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14885: mistake in sorting win1251 chars
Date: 2017-11-02 13:48:35
Message-ID: dde3e145-536e-d185-0628-359f4ade8d49@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 11/02/2017 10:57 AM, k(dot)daskalov(dot)911(at)gmail(dot)com wrote:
> The following bug has been logged on the website:
>
> Bug reference: 14885
> Logged by: Kalin Daskalov
> Email address: k(dot)daskalov(dot)911(at)gmail(dot)com
> PostgreSQL version: 9.4.4
> Operating system: windows 7 64 bit
> Description:
>
> I'm using ORDER BY <character varying field> containing win-1251 symbols.
> No matter whether the encoding is WIN1251 or UTF8.
> I try it on different versions of PostgreSQL - the result is the same.
> There is a mistake in sorted values for symbols "и" (&#1080;) and "й"
> (&#1081;) - capital letters too.
> Here is a small example:
> "АЙГЕР"
> "АИКО"
> "АЙКОН"
>

Encoding only defines how different characters are encoded, it has
nothing to do with ordering - that's what collations are for. What
lc_collate value are you using?

See https://www.postgresql.org/docs/9.4/static/collation.html

cheers

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Francisco Olarte 2017-11-02 15:38:53 Re: BUG #14885: mistake in sorting win1251 chars
Previous Message Tomas Vondra 2017-11-02 13:45:48 Re: BUG #14884: Encoding Error