On 2019-02-22 19:03, Tom Lane wrote:
> $ LANG=en_US sort stuff.txt
> ~!@#$^&(
>
> AAA
> BAA
> CAA
> DAA
With ICU (COLLATE "und-x-icu"), I get the line with the space first. I
took a bit of a look around the various Unicode documents and I don't
find anything that would defend the glibc behavior.
<obscure detail>
However, since some of those special characters are variable collating
elements and some are not, there might well be an explanation.
</obscure detail>
So, maybe try ICU.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services