Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de> writes:
> FAKDB=# select distinct f.bezeichnung from firmen f order by 1 limit 5
> FAKDB-# ;
> bezeichnung
> -----------------------------------------
> �sterreichisches Verkehrsb�ro AG
> \x01Assistenz
> \x10Frohstoff Design & Textilveredelung
> "1. Mittelschule ""Am Kupferberg"""
> (5 rows)
> FAKDB=# select distinct f.bezeichnung||'e' from firmen f order by 1 limit 5
> ;
> ?column?
> ------------------------------------------
> �sterreich/Welt (Ltg.)e
> �sterreichisches Verkehrsb�ro AGe
> \x01Assistenze
> \x10Frohstoff Design & Textilveredelunge
> "1. Mittelschule ""Am Kupferberg"""e
> (5 rows)
> Aha, the "�sterreich/Welt (Ltg.)"-entry is missing in the 1st query. So that
> does smell like a locale problem.
That only proves that adding the 'e' changes the sort order, which is
completely unsurprising for any non-C locale. What you need to do is
dump out the *entire* results of the DISTINCT queries and look for the
unmatched lines. I'd try dumping to two files, stripping the 'e' with
sed, and then sort/diff.
regards, tom lane