Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TCAyA-0001yR-9U for pgsql-sql@postgresql.org; Thu, 13 Sep 2012 15:04:42 +0000 Received: from nm21-vm7.bullet.mail.ird.yahoo.com ([212.82.109.247]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TCAy4-0002dw-FD for pgsql-sql@postgresql.org; Thu, 13 Sep 2012 15:04:42 +0000 Received: from [212.82.105.247] by nm21.bullet.mail.ird.yahoo.com with NNFMP; 13 Sep 2012 15:04:34 -0000 Received: from [212.82.108.241] by tm19.bullet.mail.ird.yahoo.com with NNFMP; 13 Sep 2012 15:04:34 -0000 Received: from [127.0.0.1] by omp1006.mail.ird.yahoo.com with NNFMP; 13 Sep 2012 15:04:34 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 724348.79424.bm@omp1006.mail.ird.yahoo.com Received: (qmail 21059 invoked by uid 60001); 13 Sep 2012 15:04:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s1024; t=1347548674; bh=ySqspjHI6feTGrDWhwumb+TcG1Swuzz+lNE90KzABR0=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=G/yvJ19QiiriEjIFRqgVDlqZljNLD2idkvz1i2PFgEqq74aUX7AZIYaNuVRiX0xc/fdrJHX6USLlASe38T2X3UcDPCtPcgo8G22j51AYNZbJA1MTEjKHRsAzqHyNXMZlyqLTOstjq1NMrHdlKf+L3JGuZPelaDObxdNjkLMQsVU= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.es; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=142WLwrN9MvfKfaxcrXSxPuRc2jOyGKWVEvSHrhmCdFjkLgKcJEHGvbUlj/rwNy019+IOF6VH9gop8qcR1fjSvm5XM7q1NqRIoQO7lYw8/B0Otr73QasOj2pBBbD/rARuDIdTyqt25G89uEepX8PzG/i7iwKdTRqY2PBLIQsRJA=; X-YMail-OSG: 7P7NfC8VM1nraqY0wZ2CibwN._8T8YounzJyfFyze5zAOSj lRrWDlS60IsZQ51jjXwaCQqyE48mVCrqMVSXbSJRK_nGUTiUAezbxCk_y8Hb kGAZqJET8TUc_E53V7zVWU8pHZeGpaIFjQD6pv.95xMofJPe36G1_QY9ZzLq Fl4U_xMYQBIOBEFMyk8NK14DojMYXBqWhu9.EE8M.pqdkSe.7g0S0iIWQQ9A JkILuQja.ZmUjDWvq4aj6gw9pInREmHU0xjuYuzAQdJlnwiH8wKAcSRYyTAw vTcNf9TbvpibES5YO5AIozLZYvibljg53B8tDYnDE.t3Q4tPxE2V0llqXhKY V60J2_PLnk8HYRMaoCI8sW.QvZZItwP8x_P.ubf.MjaLgCTXUM29GO1.Jm85 UECHAS.9CmnF2JTXFyBHdgx5DAHTBv6Gf_sMfB454ORYhbq6vtj4V6Q-- Received: from [81.60.153.125] by web29505.mail.ird.yahoo.com via HTTP; Thu, 13 Sep 2012 16:04:34 BST X-Mailer: YahooMailWebService/0.8.121.416 References: <1347535420.27469.YahooMailNeo@web29502.mail.ird.yahoo.com> <26099.1347545981@sss.pgh.pa.us> Message-ID: <1347548674.20163.YahooMailNeo@web29505.mail.ird.yahoo.com> Date: Thu, 13 Sep 2012 16:04:34 +0100 (BST) From: "Sergio C." Reply-To: "Sergio C." Subject: Re: underscore pattern in a query doens't work To: Tom Lane Cc: "pgsql-sql@postgresql.org" In-Reply-To: <26099.1347545981@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="261575577-610766888-1347548674=:20163" X-Pg-Spam-Score: -1.5 (-) X-Archive-Number: 201209/35 X-Sequence-Number: 36837 --261575577-610766888-1347548674=:20163 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Thanks Tom, for your suggestions.=0AWe started the cluster up with this com= mand:=0A./initdb -D /usr/local/postgre/data -E UTF8 -U sir=0A=0AThe rest of= the variables related to encoding (locale) are:=0Alc_collate=3DC =0Alc_cty= pe=3DC=0Alc_messages=3DC=0Alc_monetary=3DC=0Alc_numeric=3DC=0Alc_time=3DC= =0A=0ACould you tell me which more info could I give you?=0A=0A=0A_________= _______________________=0A De: Tom Lane =0APara: Sergio = Calero. =0ACC: "pgsql-sql@postgresql.org" =0AEnviado: Jueves 13 de septiembre de 2012 16:19=0AAsunto= : Re: [SQL] underscore pattern in a query doens't work=0A =0A"Sergio Calero= ." writes:=0A> I'd like to execute a query using the= underscore as a pattern.=0A> select id,etiqueta from limites_municipales w= here etiqueta like 'Garaf_a';=0A> [ but this fails to match 'Garaf=EDa' ]= =0A=0AI suspect what you have here is an encoding problem.=A0 That is, prob= ably=0Athe "=ED" is represented as a multi-byte character (most likely UTF8= )=0Abut the server thinks it's working with a single-byte encoding so that= =0Aany one character should be only one byte.=0A=0AYou didn't say what your= encoding setup is, so it's hard to do more=0Athan speculate.=0A=0A> Postgr= eSQL 8.4.1 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 3.4.6 200= 60404 (Red Hat 3.4.6-10), 64-bit=0A=0AYou do realize this is about 3 years = out of date?=A0 The 8.4 series is up=0Ato release 8.4.13, and a lot of thos= e updates contained fixes for=0Aserious bugs.=0A=0A=A0=A0=A0 =A0=A0=A0 =A0= =A0=A0 regards, tom lane=0A=0A=0A-- =0ASent via pgsql-sql mailing list (pgs= ql-sql@postgresql.org)=0ATo make changes to your subscription:=0Ahttp://www= .postgresql.org/mailpref/pgsql-sql --261575577-610766888-1347548674=:20163 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks Tom, for your suggestio= ns.
We started the cluster up with this command:
./initdb -D /usr/loc= al/postgre/data -E UTF8 -U sir

The rest of the variables related to = encoding (locale) are:
lc_collate=3DC
lc_ctype=3DC
lc_messages=3D= C
lc_monetary=3DC
lc_numeric=3DC
lc_time=3DC

Could you tell= me which more info could I give you?


De: Tom Lane <tgl@sss.pgh.pa.us> Para: Sergio Calero. &l= t;angusyoung4@yahoo.es>
CC: "pgsql-sql@postgresql.org" <pgsql-sql@postgresql.org>
Enviado: Jueves 13 de septiembre de= 2012 16:19
Asunto: Re= : [SQL] underscore pattern in a query doens't work

"= Sergio Calero." <angusyoung4@yahoo.es> writes:
> I'd l= ike to execute a query using the underscore as a pattern.
> select id= ,etiqueta from limites_municipales where etiqueta like 'Garaf_a';
> [= but this fails to match 'Garaf=EDa' ]

I suspect what you have here = is an encoding problem.  That is, probably
the "=ED" is represented= as a multi-byte character (most likely UTF8)
but the server thinks it's= working with a single-byte encoding so that
any one character should be= only one byte.

You didn't say what your encoding setup is, so it's hard to do more
than speculate.

> PostgreSQL 8.4.1 on x86_64-= unknown-linux-gnu, compiled by GCC gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-= 10), 64-bit

You do realize this is about 3 years out of date?  = The 8.4 series is up
to release 8.4.13, and a lot of those updates conta= ined fixes for
serious bugs.

       = ;     regards, tom lane


--
Sent via pgsql-sql= mailing list (pgsql-sql@postgresql.org)
To make change= s to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql=


--261575577-610766888-1347548674=:20163--