pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Lizano <david.lizano@izanet.com>
To: pgsql-admin@postgresql.org
Subject: Re: search on accents over all possible matches
Date: Tue, 27 Mar 2001 19:00:21 +0200
Message-ID: <4.3.2.7.0.20010327185220.00c1cc10@192.168.1.1> (raw)
In-Reply-To: <20010327182414.4fa5c583.teixi@6tems.com>

At 18.24 27/3/01 +0200, you wrote:
>Hello,
>
>I'm developing a search tool with php against a posgresql database.
>As the database is in catalan an in spanish is obvious that a simple
>search like:
>(SELECT * FROM painters WHERE artist_name ~* 'Dali');
>
>should perform over Dd Aa Ll Ii (and will not found Dalí).
>but on an accent based language also should perform over ÍíÌìÏï
>
>question is:
>
>this c function from Patrice Hédé is the most appropiate tool for
>searching on an accent based language ?
>http://www.postgresql.org/mhonarc/pgsql-sql/1998-06/msg00119.html
>
>or should I use an implemented function inside postgres right now ?
>
>bests from barcelona,
>jaume teixi.

Using regular expressions from PHP you can convert "a" into "[Aaáä]" and 
from the original SQL query:
         (SELECT * FROM painters WHERE artist_name ~* 'Dali');

You obtain
         (SELECT * FROM painters WHERE artist_name ~* 'D[Aaáä]l[Iiíï]');

generating a new complete regular expression for the SQL language.

It should be valid for Dali, Dáli, Dalí, Dálí, and others.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David Lizano - Director área técnica
correo-e: david.lizano@izanet.com

I Z A N E T - Servicios integrales de internet.
web: http://www.izanet.com/
Dirección: C/ Checa, 57-59, 3º D - 50.007 Zaragoza (España)
Teléfono: +34 976 25 80 23    Fax: +34 976 25 80 24
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




view thread (3+ messages)  latest in thread

Message-ID: <4.3.2.7.0.20010327185220.00c1cc10@192.168.1.1>
Permalink:  ../4.3.2.7.0.20010327185220.00c1cc10@192.168.1.1/
Also on:    postgresql.org/message-id/4.3.2.7.0.20010327185220.00c1cc10@192.168.1.1

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: david.lizano@izanet.com
  Subject: Re: search on accents over all possible matches
  In-Reply-To: <4.3.2.7.0.20010327185220.00c1cc10@192.168.1.1>
  References: <20010327182414.4fa5c583.teixi@6tems.com> <4.3.2.7.0.20010327185220.00c1cc10@192.168.1.1>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox