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

contrib/levenshtein() has a bug?

From: Ben <bench(at)silentmedia(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: contrib/levenshtein() has a bug?
Date: 2006-09-28 19:02:34
Message-ID: Pine.LNX.4.64.0609281157250.21293@GRD.cube42.tai.silentmedia.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-patches
The levenshtein function from contrib/fuzzystrmatch.sql has a max arg 
length of 255. OK, that's cool. But check this out:

mbrainz_db=> select max(length(name)) from public.track;
  max
-----
  255
(1 row)

mbrainz_db=> select levenshtein(name,'foo') from public.track; 
ERROR:  argument exceeds max length: 255


That seems odd. What's odder is:

mbrainz_db=> select levenshtein(substring(name for 100),'foo') from public.track;
ERROR:  argument exceeds max length: 255



Any suggestions? I'm using the Fedora 5 rpms, so it looks like that puts 
me at 8.1.4.

Responses

pgsql-patches by date

Next:From: Martijn van OosterhoutDate: 2006-09-28 19:37:07
Subject: Re: contrib/levenshtein() has a bug?
Previous:From: David FetterDate: 2006-09-28 18:54:55
Subject: Numeric overflow problem + patch

pgsql-general by date

Next:From: Martijn van OosterhoutDate: 2006-09-28 19:37:07
Subject: Re: contrib/levenshtein() has a bug?
Previous:From: Tom LaneDate: 2006-09-28 18:14:14
Subject: Re: Strange query results with invalid multibyte

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