Compute The Levenshtein Distance Of Two Strings

August 12, 2019 ยท View on GitHub

PostgreSQL has a built-in function for computing the Levenshtein distance between two strings.

> select levenshtein('hello', 'world');
 levenshtein
-------------
           4

> select levenshtein('function', 'funtcion');
 levenshtein
-------------
           2

Check out the fuzzystrmatch module for more details.