From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Marc Millas <marc.millas@mokadb.com>
To: pgsql-general@postgresql.org
Subject: Re: sort order
Date: Fri, 6 Aug 2021 17:57:51 +0200
Message-ID: <3940ae46-b123-f58e-aa58-e6f9309b5ef6@enterprisedb.com> (raw)
In-Reply-To: <CADX_1abnuUch2aUPaJCFbwNXKVZKf-dzwsj81O0OSy2CNdb41Q@mail.gmail.com>
References: <CADX_1abnuUch2aUPaJCFbwNXKVZKf-dzwsj81O0OSy2CNdb41Q@mail.gmail.com>
On 27.07.21 19:07, Marc Millas wrote:
> so, obviously, both lc_collate knows about the é
> but obviously, too, they do behave differently on the impact of the
> beginning white space.
>
> I didn't see anything about this behaviour on the doc, unless the
> reference at the libc should be understood as please read and test libc
> doc on each platform.
> So my first question is: why ?
> My second question is: how to make the centos postgres behave like the
> w10 one ??
> ie. knowing about french characters AND taking beginning white spaces
> into account ?
There are multiple standard ways to deal with space and punctuation
characters when sorting. See
<https://unicode-org.github.io/icu/userguide/collation/customization/ignorepunct.html;
for a description. Not all collation providers implement all of them,
but the behavior you happen to get is usually one of them. The centos 7
behavior corresponds to "shift-trimmed", the Windows one appears to
match "non-ignorable". If you want to get that latter one on Linux as
well, you can use the ICU locales, which also default to non-ignorable.
For example
select * from test order by ble collate "fr-x-icu";
matches your Windows output for me.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: peter.eisentraut@enterprisedb.com, marc.millas@mokadb.com
Subject: Re: sort order
In-Reply-To: <3940ae46-b123-f58e-aa58-e6f9309b5ef6@enterprisedb.com>
References: <CADX_1abnuUch2aUPaJCFbwNXKVZKf-dzwsj81O0OSy2CNdb41Q@mail.gmail.com> <3940ae46-b123-f58e-aa58-e6f9309b5ef6@enterprisedb.com>
* 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