Re: BUG #3323: Wrong charset for the lower and upper functions

Lists: pgsql-bugs
From: "Eduardo Santos" <eduardo(dot)edusantos(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3323: Wrong charset for the lower and upper functions
Date: 2007-05-30 19:40:54
Message-ID: 200705301940.l4UJeswh031870@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3323
Logged by: Eduardo Santos
Email address: eduardo(dot)edusantos(at)gmail(dot)com
PostgreSQL version: 8.2.4
Operating system: Windows
Description: Wrong charset for the lower and upper functions
Details:

When you have the latin character and use the lower or the upper
function, instead of return the approprite character, it returns the oposite
one, so the comparisons in the whole DB are wrong. If you have a word such
as Servio, and you use the lower function, the result is servio, instead
of servio. the other side is also true: if you use upper in the same eord,
the result is SERVIO, instead of SERVIO.

select upper('Servio');
Expected result: SERVIO
Actual result: SERVIO

select lower('Servio');
Expected result: servio
Actual result: servio


From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Eduardo Santos <eduardo(dot)edusantos(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3323: Wrong charset for the lower and upper functions
Date: 2007-05-31 02:55:15
Message-ID: 465E3913.8000208@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Eduardo Santos wrote:

> When you have the latin character ç and use the lower or the upper
> function, instead of return the approprite character, it returns the oposite
> one, so the comparisons in the whole DB are wrong. If you have a word such
> as Serviço, and you use the lower function, the result is serviÇo, instead
> of serviço. the other side is also true: if you use upper in the same eord,
> the result is SERVIçO, instead of SERVIÇO.
>
Did you read [1] for issues with code page on Windows console windows?
What kind of encoding are you using? I haven't reproduce your problem here.

[1] http://www.postgresql.org/docs/8.2/static/app-psql.html

--
Euler Taveira de Oliveira
http://www.timbira.com/


From: "Eduardo Ferreira" <eduardo(dot)edusantos(at)gmail(dot)com>
To: "Euler Taveira de Oliveira" <euler(at)timbira(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3323: Wrong charset for the lower and upper functions
Date: 2007-05-31 03:10:31
Message-ID: 266b12630705302010i21e4a870n250d0d47013e0d1d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi,

I haven't seen this issue for windows console, but I don't think it affects
my DB. Anyway, I'm using Unicode (UTF8), and this is the only problem I had.
If it had something to do with the encoding, the results would be very
different (such as the wrong character as result for the function).

My guess is that the order is reversed for the ç only. I'll try to fix the
windows console issue and tell you the results later. Thanks for your help.

2007/5/30, Euler Taveira de Oliveira <euler(at)timbira(dot)com>:
>
> Eduardo Santos wrote:
>
> > When you have the latin character ç and use the lower or the upper
> > function, instead of return the approprite character, it returns the
> oposite
> > one, so the comparisons in the whole DB are wrong. If you have a word
> such
> > as Serviço, and you use the lower function, the result is serviÇo,
> instead
> > of serviço. the other side is also true: if you use upper in the same
> eord,
> > the result is SERVIçO, instead of SERVIÇO.
> >
> Did you read [1] for issues with code page on Windows console windows?
> What kind of encoding are you using? I haven't reproduce your problem
> here.
>
> [1] http://www.postgresql.org/docs/8.2/static/app-psql.html
>
> --
> Euler Taveira de Oliveira
> http://www.timbira.com/
>