multibyte charater set in levenshtein function

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: multibyte charater set in levenshtein function
Date: 2010-05-10 15:35:02
Message-ID: AANLkTinbhlfvWhT_sUOEQj1IHzJdGE-dUUZCXq-3QqYm@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

The current version of levenshtein function in fuzzystrmatch contrib modulte
doesn't work properly with multibyte charater sets.

test=# select levenshtein('фыва','аыва');
levenshtein
-------------
2
(1 row)

My patch make this function works properly with multibyte charater sets.

test=# select levenshtein('фыва','аыва');
levenshtein
-------------
1
(1 row)

Also it avoids text_to_cstring call.

Regards,
Alexander Korotkov.

Attachment Content-Type Size
fuzzystrmatch.diff.gz application/x-gzip 2.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2010-05-10 15:39:00 Re: max_standby_delay considered harmful
Previous Message Mike Rylander 2010-05-10 15:22:20 Re: max_standby_delay considered harmful