Search Postgresql Archives

Re: problem with query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






On Thu, Sep 12, 2013 at 6:49 PM, Chris Curvey <chris@xxxxxxxxxxxxxxx> 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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux