Re: Select with string that has a lone hyphen yields nothing

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Kenichiro Tanaka <ketanaka(at)ashisuto(dot)co(dot)jp>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Select with string that has a lone hyphen yields nothing
Date: 2010-05-01 05:59:51
Message-ID: 4BDBC357.70005@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 30/04/2010 5:33 PM, Kenichiro Tanaka wrote:
> Hi
>
> The hyphen which written in 'Olympus E-PL1' is different from
> the one which written in 'Camera - Black'.
>
> em-dash
> http://www.fileformat.info/info/unicode/char/2014/index.htm
> en-dash
> http://www.fileformat.info/info/unicode/char/2013/index.htm
> figure-dash
> http://www.fileformat.info/info/unicode/char/2012/index.htm
>
> I have no idea to fix using PostgreSQL's function,because they don't equal.
> I think you have to change the data or change the behavior of your
> application .

The usual solution to this sort of thing is to provide a functional
index on the problem field that computes a "simplified" version of the
text - stripping accents, dumbing all dashes down to simple minus signs,
etc.

I'm not aware of any canned tool to do this in PostgreSQL. Everyone's
needs seem to vary, so it'd be hard to provide one.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2010-05-01 06:59:42 Re: Native DB replication for PG
Previous Message Scott Marlowe 2010-05-01 05:38:01 Re: Native DB replication for PG