pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Debraj Manna <subharaj.manna@gmail.com>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Difference between C and en_US.UTF-8 Collate & CType in Postgres 10.x
Date: Fri, 14 Sep 2018 13:57:38 +0200
Message-ID: <0f5ad1359ca05bb3e77c346aa012b1df1d8f5429.camel@cybertec.at> (raw)
In-Reply-To: <CAF6DVKNU0vb4ZeQQ-=agg69QJU3wdjPnMYYrPYY7CKc6iOU7eQ@mail.gmail.com>
References: <CAF6DVKNU0vb4ZeQQ-=agg69QJU3wdjPnMYYrPYY7CKc6iOU7eQ@mail.gmail.com>

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





view thread (6+ messages)  latest in thread

Message-ID: <0f5ad1359ca05bb3e77c346aa012b1df1d8f5429.camel@cybertec.at>
Permalink:  ../0f5ad1359ca05bb3e77c346aa012b1df1d8f5429.camel@cybertec.at/
Also on:    postgresql.org/message-id/0f5ad1359ca05bb3e77c346aa012b1df1d8f5429.camel@cybertec.at

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, subharaj.manna@gmail.com
  Subject: Re: Difference between C and en_US.UTF-8 Collate & CType in Postgres 10.x
  In-Reply-To: <0f5ad1359ca05bb3e77c346aa012b1df1d8f5429.camel@cybertec.at>

* 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