Yahor Yuzefovich <yahor(at)cockroachlabs(dot)com> writes:
> I expected to see:
> A
> M
> i
> but found:
> A
> i
> M
That would be a matter of what collation you're running it under ...
if sort(1) sorts the same way, it's not a PG issue.
regards, tom lane