To answer my own question: it seems that the problem is not with
postgresql but with the FreeBSD OS. FreeBSD does not support sorting by
unicode characters, so I need to recompile the postgresql server with
"use ICU for unicode collation" flag.
2016.03.06. 10:13 keltezéssel, Nagy László Zsolt írta:
> Example database on a Unix system:
>
> CREATE DATABASE test
> TEMPLATE = template0
> ENCODING = 'UTF8'
> LC_COLLATE = 'hu_HU.UTF-8'
> LC_CTYPE = 'hu_HU.UTF-8'
> CONNECTION LIMIT = -1;