Unix Technical Forum

BUG #2070: Encoding dependent error in comparison operators

This is a discussion on BUG #2070: Encoding dependent error in comparison operators within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2070 Logged by: Jan Jockusch Email address: jan@jockusch.de PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:29 AM
Jan Jockusch
 
Posts: n/a
Default BUG #2070: Encoding dependent error in comparison operators


The following bug has been logged online:

Bug reference: 2070
Logged by: Jan Jockusch
Email address: jan@jockusch.de
PostgreSQL version: 8.1.0
Operating system: Linux
Description: Encoding dependent error in comparison operators
Details:

With terminal encoding Latin-1, client encoding Latin-1
and database encoding LATIN1, I do:

\l
Name | Owner | Encoding
---------------+----------+-----------
encoding_test | postgres | LATIN1
....
encoding_test=# select 'ä' = 'ö';
?column?
----------
t
(1 row)

And although the two values are quite clearly
different, the operator finds them equal.

I hope you see the different umlauts in the query
(also latin-1 encoded).

The comparison operator works OK for 7-bit ASCII values
and finds characters below 128 different from those
above 128. It finds all characters above 128 equal, though.

The bug also applies for ascii strings which are the
same except for a different umlaut at the same
position, e.g. 'Größe' = 'Grüße'. This comparison
also renders true in latin-1 scenarios.

The bug does not apply for clean UTF-8 scenarios.

I think this is a serious bug which produces surprising
and very hard to find problems. If I can be of any
assistance in diagnosing or fixing, please contact me.

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 10:29 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #2070: Encoding dependent error in comparison operators

"Jan Jockusch" <jan@jockusch.de> writes:
> With terminal encoding Latin-1, client encoding Latin-1
> and database encoding LATIN1, I do:


.... and what database locale? This sort of misbehavior is a common
symptom of having a database encoding that's not what the locale
expects.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:18 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com