pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Kirk Wolak <wolakk@gmail.com>
Cc: Oscar Carlberg <oscar.carlberg@fortnox.se>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: ICU, locale and collation question
Date: Wed, 10 May 2023 07:23:13 +0200
Message-ID: <bd1fac9a-afc5-5101-0f57-ea877cf51003@enterprisedb.com> (raw)
In-Reply-To: <CACLU5mSqWDVD1JCHy75F9r8ThFgpFgKcY=isDpiKd5L0u1KFvQ@mail.gmail.com>
References: <2a1de395-c69a-3dae-4459-dbdb633df637@fortnox.se>
	<ae423dcf4beb77c20053bedb501400e01e5f2724.camel@cybertec.at>
	<4210aaef-06ff-628e-a2c8-a1a4bf28d278@fortnox.se>
	<e581e338-deea-2901-aa37-bf882077c377@enterprisedb.com>
	<CACLU5mSqWDVD1JCHy75F9r8ThFgpFgKcY=isDpiKd5L0u1KFvQ@mail.gmail.com>

On 10.05.23 07:02, Kirk Wolak wrote:
> On Tue, May 9, 2023 at 11:24 AM Peter Eisentraut 
> <peter.eisentraut@enterprisedb.com 
> <mailto:peter.eisentraut@enterprisedb.com>> wrote:
> 
>     On 09.05.23 08:54, Oscar Carlberg wrote:
>      > Our initdb setup would then look like this for compatibility;
>      > -E 'UTF-8'
>      > --locale-provider=icu
>      > --icu-locale=sv-SE-x-icu
>      > --lc_monetary=sv_SE.UTF-8
>      > --lc-numeric=sv_SE.UTF-8
>      > --lc-time=sv_SE.UTF-8
>      > --lc-messages=en_US.UTF-8
>      >
>      > Should we still provide createdb with --lc-collate=C and
>     --lc-ctype=C,
>      > or should we set those to sv_SE.UTF-8 as well?
> 
>     You should set those to something other than C.  It doesn't matter much
>     what exactly, so what you have there is fine.
> 
>     Setting it to C would for example affect the ability of the text search
>     functionality to detect words containing non-ASCII characters.
> 
> Doesn't searching LIKE 'abc%'  behave much better for C than others.  
> This was the driving force for choosing C for us.
> [EXPLAIN made it clear that it was range bound until 'abd']

For that use, I would recommend making an index specifically on the 
tables you need, instead of switching the whole database.

Also, if you are using the ICU provider for the database, then setting 
lc_collation=C wouldn't even affect LIKE optimization, because the ICU 
locale would be used.





view thread (7+ messages)

Message-ID: <bd1fac9a-afc5-5101-0f57-ea877cf51003@enterprisedb.com>
Permalink:  ../bd1fac9a-afc5-5101-0f57-ea877cf51003@enterprisedb.com/
Also on:    postgresql.org/message-id/bd1fac9a-afc5-5101-0f57-ea877cf51003@enterprisedb.com

 · 

reply

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, wolakk@gmail.com, oscar.carlberg@fortnox.se, laurenz.albe@cybertec.at
  Subject: Re: ICU, locale and collation question
  In-Reply-To: <bd1fac9a-afc5-5101-0f57-ea877cf51003@enterprisedb.com>
  References: <2a1de395-c69a-3dae-4459-dbdb633df637@fortnox.se> <ae423dcf4beb77c20053bedb501400e01e5f2724.camel@cybertec.at> <4210aaef-06ff-628e-a2c8-a1a4bf28d278@fortnox.se> <e581e338-deea-2901-aa37-bf882077c377@enterprisedb.com> <CACLU5mSqWDVD1JCHy75F9r8ThFgpFgKcY=isDpiKd5L0u1KFvQ@mail.gmail.com> <bd1fac9a-afc5-5101-0f57-ea877cf51003@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