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