Sorting problems with SELECT * FROM table WHERE name LIKE 'Ö%' - Mailing list pgsql-general

From Nico Grubert
Subject Sorting problems with SELECT * FROM table WHERE name LIKE 'Ö%'
Date
Msg-id 4364F1FD.6040102@arcor.de
Whole thread Raw
Responses Re: Sorting problems with SELECT * FROM table WHERE name LIKE 'Ö%'
Re: [GENERAL] Sorting problems with SELECT * FROM table WHERE name LIKE 'Ö%'
List pgsql-general
Hi there,

I have a problem when sorting records with:
SELECT * FROM table WHERE name LIKE 'Ö%'

I am running Postgres 8.02 with a database whose character encoding is
UNICODE.

The SQL Query

   SELECT *
     FROM member
     WHERE name LIKE 'O%'
           OR
           name like 'Ö%'
     ORDER BY name


returns this:
  Öhlmann
  Öhmann
  Obenaus
  Ochoa
  O'Donovan
  Oehme
  Oklant
  Oltub
  Oltüch
  Oltutz
  Oltüwer

According to german sorting rules the result is fine except the both
first entries "Öhlmann" and "Öhmann".
Why do appear these records at the beginning of the list?
The proper result should read like this:
  Obenaus
  Ochoa
  O'Donovan
  Oehme
  Öhlmann
  Öhmann
  Oklant
  Oltub
  Oltüch
  Oltutz
  Oltüwer



The same problem accours when using "E" where my result is this:
   Élie de Beaumont
   Eberer
   Ecü
   Edding
   Emmer

The proper result should be:
   Eberer
   Ecü
   Edding
   Élie de Beaumont
   Emmer


Any idea how I can solve this problem?


Thank you very much in advance,
Nico

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Please HELP - URGENT - transaction wraparound error
Next
From: John Sidney-Woollett
Date:
Subject: Re: Please HELP - URGENT - transaction wraparound error