Re: add soundex difference function to contrib/fuzzystrmatch - Mailing list pgsql-patches

From Kris Jurka
Subject Re: add soundex difference function to contrib/fuzzystrmatch
Date
Msg-id Pine.BSO.4.56.0501250214120.29396@leary.csoft.net
Whole thread Raw
In response to Re: add soundex difference function to  (Neil Conway <neilc@samurai.com>)
Responses Re: add soundex difference function to
Re: add soundex difference function to contrib/fuzzystrmatch
List 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

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: add soundex difference function to
Next
From: Neil Conway
Date:
Subject: Re: add soundex difference function to