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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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 Content-Type Size
strict.text_soundex.patch text/plain 868 bytes
soundex.difference-2.patch text/plain 6.4 KB

In response to

Responses

Browse pgsql-patches by date

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