Skip site navigation (1) Skip section navigation (2)

Re: UTF-8 and LIKE vs =

From: Ian Barwick <barwick(at)gmail(dot)com>
To: David Wheeler <david(at)kineticode(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: UTF-8 and LIKE vs =
Date: 2004-08-23 20:58:45
Message-ID: 1d581afe0408231358127c3e6f@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
On Mon, 23 Aug 2004 12:41:30 -0700, David Wheeler <david(at)kineticode(dot)com> wrote:
(...)
> bric=# select version();
>                                                   version
> ------------------------------------------------------------------------
> ---------------------------------
>   PostgreSQL 7.4.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2
> 20030222 (Red Hat Linux 3.2.2-5)
> (1 row)
> 
> bric=# select * from keyword where name = '북한의';
>    id  |  name  | screen_name | sort_name | active
> ------+--------+-------------+-----------+--------
>   1218 | 국방비 | 국방비      | 국방비    |      1
> (1 row)

er, the characters in "name" don't seem to match the characters in the
query - '국방비' vs. '북한의' - does that have any bearing?
 
FWIW (on 7.4.3):

test=#  select * from t1 ;
 id | value
----+--------
  1 | 日本
  2 | 日本語
  3 | 北海道
(3 rows)

test=#  select * from t1 where value ~ '日';
 id | value
----+--------
  1 | 日本
  2 | 日本語
(2 rows)

test=# select * from t1 where value like '日%';
 id | value
----+--------
  1 | 日本
  2 | 日本語

test=# select * from t1 where value like '北海%';
 id | value
----+--------
  3 | 北海道
(1 row)

Ian Barwick
barwick(at)gmail(dot)net

In response to

Responses

pgsql-general by date

Next:From: David WheelerDate: 2004-08-23 21:04:05
Subject: Re: UTF-8 and LIKE vs =
Previous:From: David WheelerDate: 2004-08-23 20:43:18
Subject: Re: UTF-8 and LIKE vs =

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group