Re: problem with query

From: Roberto Scattini <roberto(dot)scattini(at)gmail(dot)com>
To: chris(at)chriscurvey(dot)com
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: problem with query
Date: 2013-09-12 22:03:48
Message-ID: CAApYZY-cQARqvjT=CFjKVabCgeUdKDQaAe1xA7bJ7e1dm7MS8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 12, 2013 at 6:49 PM, Chris Curvey <chris(at)chriscurvey(dot)com> wrote:

>
>>
> Is this just a case-sentitvity issue? if personas.apellido is a varchar
> field, then I think that's your trouble. (it would have to be citext in
> order for "nunez" = "NUNEZ".)
>
>
>
yes, is just a case-sensitivity issue. yes, is a varchar field.
but what i dont understand is why the problem of "insensitivity" is only
with ñ (lower). i mean, if i remove my ñ (and subsecuent chars), both
querys return the same rows:

pgon=# set client_encoding = SQL_ASCII;
SET
pgon=# SELECT DISTINCT
p.id, p.apellido, p.nombre
FROM personal.personas AS p
WHERE p.apellido ilike '%NU%';
id | apellido | nombre
-------+----------------+------------------
39489 | NUÑEZ | JUAN
39937 | PEREZ NUÑEZ | FRANCISCO
40229 | PANNUNZIO | MARIA CRISTINA
39453 | GUARNUCIO | CARLA GISELLE
39498 | NUÑEZ ESQUIBEL | RICARDO RODOLFO
40326 | MANUZZA | ANDREA ALEJANDRA
40205 | NIETO FRAGNUL | LAUTARO ALFREDO
40220 | NUÑEZ VERA | MANUEL SANTIAGO
(8 rows)

pgon=# SELECT DISTINCT
p.id, p.apellido, p.nombre
FROM personal.personas AS p
WHERE p.apellido ilike '%nu%';
id | apellido | nombre
-------+----------------+------------------
39489 | NUÑEZ | JUAN
39937 | PEREZ NUÑEZ | FRANCISCO
40229 | PANNUNZIO | MARIA CRISTINA
39453 | GUARNUCIO | CARLA GISELLE
39498 | NUÑEZ ESQUIBEL | RICARDO RODOLFO
40326 | MANUZZA | ANDREA ALEJANDRA
40205 | NIETO FRAGNUL | LAUTARO ALFREDO
40220 | NUÑEZ VERA | MANUEL SANTIAGO
(8 rows)

what makes the 'ñ' char special that makes the queries the same when it is
not there?

--
Roberto Scattini

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Roberto Scattini 2013-09-12 22:07:04 Re: problem with query
Previous Message Bosco Rama 2013-09-12 22:02:19 Re: problem with query