problems when comparing text with special chars - Mailing list pgsql-novice

From
Subject problems when comparing text with special chars
Date
Msg-id 00ea01c5b0ce$10017650$1500a8c0@iwing
Whole thread Raw
Responses Re: problems when comparing text with special chars  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-novice by date:

Previous
From: "Morgan Kita"
Date:
Subject: Re: UPDATE: pg_dump fails due to invalid memory request
Next
From: "Morgan Kita"
Date:
Subject: Re: UPDATE: pg_dump fails due to invalid memory request