Received: from correo.servidoresdns.net ([195.55.179.56]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2RH25w37030 for ; Tue, 27 Mar 2001 12:02:08 -0500 (EST) (envelope-from david.lizano@izanet.com) Received: from servidornt.izanet.com [195.55.250.69] by correo.servidoresdns.net with ESMTP (SMTPD32-6.04) id A71634C00138; Tue, 27 Mar 2001 19:00:06 +0200 Message-Id: <4.3.2.7.0.20010327185220.00c1cc10@192.168.1.1> X-Sender: sj7010@192.168.1.1 X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Tue, 27 Mar 2001 19:00:21 +0200 To: pgsql-admin@postgresql.org From: David Lizano Subject: Re: search on accents over all possible matches In-Reply-To: <20010327182414.4fa5c583.teixi@6tems.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.postgresql.org id f2RH2Gw37046 X-Archive-Number: 200103/197 X-Sequence-Number: 1044 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~