Re: BUG #15317: Sort order error - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #15317: Sort order error
Date
Msg-id 7039133c-fe5b-4036-cba1-c66f24b2c607@iki.fi
Whole thread Raw
In response to BUG #15317: Sort order error  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
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


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15318: ERROR: current transaction is aborted,commands ignored until end of transaction block
Next
From: Sergei Kornilov
Date:
Subject: Re: BUG #15318: ERROR: current transaction is aborted, commands ignored until end of transaction block