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

Re: add soundex difference function to contrib/fuzzystrmatch

From: Kris Jurka <books(at)ejurka(dot)com>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: add soundex difference function to contrib/fuzzystrmatch
Date: 2005-01-25 07:26:31
Message-ID: Pine.BSO.4.56.0501250214120.29396@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-patches

On Tue, 25 Jan 2005, Neil Conway wrote:

> On Tue, 2005-01-25 at 01:13 -0500, Kris Jurka wrote:
> > The attached patch implements the soundex difference function which 
> > compares two strings' soundex values for similarity.
> 
> *** 19,24 ****
> --- 19,28 ----
>   AS 'MODULE_PATHNAME', 'soundex'
>   LANGUAGE 'C';
>   
> + CREATE FUNCTION difference(text,text) RETURNS int
> + AS 'MODULE_PATHNAME', 'difference'
> + LANGUAGE 'C';
> + 
> 
> This should be immutable, right?
> 

Yes, it should, and even more importantly strict because it crashes when
called with null inputs.  I copied this off the adjacent entry without
thinking about it.  So currently SELECT text_soundex(NULL); crashes the
server.  I've attached two new patches.  One revising my original patch to
make the function creations consistent and the other to just fix the
problem in the existing code (which should be backported as far as people
would like to).

Kris Jurka

Attachment: soundex.difference-2.patch
Description: text/plain (6.4 KB)
Attachment: strict.text_soundex.patch
Description: text/plain (868 bytes)

In response to

Responses

pgsql-patches by date

Next:From: Manfred KoizarDate: 2005-01-25 07:33:57
Subject: Re: Much Ado About COUNT(*)
Previous:From: Neil ConwayDate: 2005-01-25 07:05:52
Subject: Re: add soundex difference function to

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