pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: pahwa.sumit@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>
Subject: Re: BUG #15317: Sort order error
Date: Wed, 8 Aug 2018 11:26:48 +0300
Message-ID: <7039133c-fe5b-4036-cba1-c66f24b2c607@iki.fi> (raw)
In-Reply-To: <153371119378.1298.16323419052428888575@wrigleys.postgresql.org>
References: <153371119378.1298.16323419052428888575@wrigleys.postgresql.org>

On 08/08/18 09:53, PG Bug reporting form wrote:
> When I execute a query
> select 'ALEX DARGAY' >  'ALEXANDER';
> It should return false as output because ascii value of space is lower than
> ascii value of 'A'.
> But the output is true, which is incorrect.

The correct answer to that query depends on the current locale. You seem 
to be assuming that POSIX / C locale is used. You can check the current 
locale's collation order with "show lc_collate;". The locale support is 
provided by the Operating System, so even if the locale is nominally the 
same, e.g. "UK English", it might behave slightly differently on 
different systems.

See the user manual, sections 23.1 Locale Support and 23.2 Collation 
Support for more information:

https://www.postgresql.org/docs/10/static/locale.html
https://www.postgresql.org/docs/10/static/collation.html

- Heikki




view thread (2+ messages)

Message-ID: <7039133c-fe5b-4036-cba1-c66f24b2c607@iki.fi>
Permalink:  ../7039133c-fe5b-4036-cba1-c66f24b2c607@iki.fi/
Also on:    postgresql.org/message-id/7039133c-fe5b-4036-cba1-c66f24b2c607@iki.fi

 · 

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-bugs@postgresql.org
  Cc: hlinnaka@iki.fi, noreply@postgresql.org
  Subject: Re: BUG #15317: Sort order error
  In-Reply-To: <7039133c-fe5b-4036-cba1-c66f24b2c607@iki.fi>
  References: <153371119378.1298.16323419052428888575@wrigleys.postgresql.org> <7039133c-fe5b-4036-cba1-c66f24b2c607@iki.fi>

* 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