problems when comparing text with special chars

From: <me(at)alternize(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: problems when comparing text with special chars
Date: 2005-09-03 21:25:52
Message-ID: 00ea01c5b0ce$10017650$1500a8c0@iwing
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

hi list

i got a weird problem. somehow, for pg-sql, this statement is not true:

SELECT lower('zwiebelbäcker') = 'zwiebelbäcker'
=> false (which is the wrong answer, obviously)

amazingly, this one works fine:

SELECT lower('zwiebelbacker') = 'zwiebelbacker'
=> true

thus, the following query fails:

SELECT login FROM users.users WHERE lower(login) = 'zwiebelbäcker'
=> 0 Result (not correct!!)

workaround:

SELECT login FROM users.users WHERE lower(login) = lower('zwiebelbäcker')
=> 1 Result (correct)

why is this and how can it be circumvented? my workaround of using lower()
only works as so long as i don't want case-insensitive checks... i've
already tried to cast it to text by using ::text, didn't help.

thanks,
thomas

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Morgan Kita 2005-09-03 21:40:59 Re: UPDATE: pg_dump fails due to invalid memory request
Previous Message Morgan Kita 2005-09-03 20:48:49 Re: UPDATE: pg_dump fails due to invalid memory request