Re: encoding problem

Lists: pgsql-general
From: marcelo Cortez <jmdc_marcelo(at)yahoo(dot)com(dot)ar>
To: pgsql-general(at)postgresql(dot)org
Subject: encoding problem
Date: 2005-12-01 14:46:43
Message-ID: 20051201144643.59071.qmail@web35614.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

folks

i have problems with encodings
the scenario is:

database: CREATE DATABASE "testLatin"
WITH OWNER = owner1
ENCODING = 'LATIN9';
test table:

CREATE TABLE test
( nombre varchar(20))
WITH OIDS;
ALTER TABLE test OWNER TO marcelo;
data:
nombre
---------
"maricón"
"ñañoso pícaro"

test statement
select * from test where upper(nombre) like 'ÑA%'
not data found !!!

any ideas?
best regards

MDC

pd: Unicode encoding has same result.



___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: marcelo Cortez <jmdc_marcelo(at)yahoo(dot)com(dot)ar>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: encoding problem
Date: 2005-12-01 16:09:55
Message-ID: 11442.1133453395@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

marcelo Cortez <jmdc_marcelo(at)yahoo(dot)com(dot)ar> writes:
> i have problems with encodings

You need to make sure that the database locale matches what you want,
not only the encoding.

See the "Localization" chapter in the docs:
http://www.postgresql.org/docs/8.1/static/charset.html

regards, tom lane


From: marcelo Cortez <jmdc_marcelo(at)yahoo(dot)com(dot)ar>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: encoding problem
Date: 2005-12-01 17:15:01
Message-ID: 20051201171501.89674.qmail@web35608.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


--- Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> escribió:

> marcelo Cortez <jmdc_marcelo(at)yahoo(dot)com(dot)ar> writes:
> > i have problems with encodings
>
> You need to make sure that the database locale
> matches what you want,
> not only the encoding.
>
> See the "Localization" chapter in the docs:
>
http://www.postgresql.org/docs/8.1/static/charset.html
>
> regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map
> settings
>



___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar


From: Volkan YAZICI <volkan(dot)yazici(at)gmail(dot)com>
To: marcelo Cortez <jmdc_marcelo(at)yahoo(dot)com(dot)ar>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: encoding problem
Date: 2005-12-02 11:55:41
Message-ID: 7104a7370512020355j29be1e99nc06968864aa878de@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 12/1/05, marcelo Cortez <jmdc_marcelo(at)yahoo(dot)com(dot)ar> wrote:
> i have problems with encodings

PostgreSQL case conversion functions is a little bit buggy.
(Especially for Latin-N and Unicode encodings.) I've prepared a patch
[1] to fix a similar problem for Latin5 encoding. It wasn't tested so
much but works for your problem too:

template1=# CREATE DATABASE "testLatin" ENCODING = 'LATIN9';
CREATE DATABASE
template1=# \c testLatin
You are now connected to database "testLatin".
testLatin=# CREATE TABLE test
testLatin-# ( nombre varchar(20));
CREATE TABLE
testLatin=# COPY test FROM stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
>> maricón
>> ñañoso pícaro
>> \.
testLatin=# select * from test where upper(nombre) like 'ÑA%';
nombre
---------------
ñañoso pícaro
(1 row)

[1] You can find related patch (and discussion) @
http://archives.postgresql.org/pgsql-patches/2005-11/msg00173.php
address. It fixes case conversion problems for ILIKE, upper() and
lower() functions.

Regards.