Re: Difference between C and en_US.UTF-8 Collate & CType in Postgres 10.x

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Debraj Manna <subharaj(dot)manna(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Difference between C and en_US.UTF-8 Collate & CType in Postgres 10.x
Date: 2018-09-14 11:57:38
Message-ID: 0f5ad1359ca05bb3e77c346aa012b1df1d8f5429.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Debraj Manna wrote:
> Can someone let me know what is the difference we are expected to observe if we set
> Collate & Ctype to C as against en_US.UTF-8 with encoding set to UTF8 in both the cases ?

For one, the ordering will be substantially different.

Compare the result of these two queries:

SELECT chr(i) FROM generate_series(1, 50000) i ORDER BY chr(i) COLLATE "C";
SELECT chr(i) FROM generate_series(1, 50000) i ORDER BY chr(i) COLLATE "en_US.utf8";

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Amine Tengilimoglu 2018-09-15 06:10:35 postgresql HA solution for different network domain
Previous Message 范国腾 2018-09-14 09:34:20 how to debug the postgres performance issue