"TomasKlockar" <tomask@omicron.se> writes:
> I think the database was initialized with UTF8 but it might have been
> ISO_8859-1, however the error is easily repeatable and ill be happy to
> provide a dump.
If the database encoding doesn't match the database locale (server
LC_COLLATE setting), all kinds of very strange sorting behavior can
ensue. I suspect you've been bit by this gotcha.
regards, tom lane