I have installed postgresql according to this, but I also need fuzzy string match functions, but I have no idea how to install these.

5 Answers 5


For the Mac, the .sql files are in a folder such as /Library/PostgreSQL/8.3/share/postgresql/contrib

  • For me, it was in /Library/PostgresPlus/8.3/share/contrib . Jun 10, 2009 at 23:31

If you are looking for levenshtein or other functions in fuzzystrmatch package in postgresql 9.1, just do this:

# Login with postgres user and:
psql my_database -U postgres
# Enter the postgres password and type in the psql shell:
CREATE EXTENSION fuzzystrmatch;



If you can't find that extension, it's possible you didn't install postgres contrib.

for instance, on centos style os's:

yum install postgresql93-contrib

Based on the answer here in the context of a Rails migration, all it takes is:

create extension fuzzystrmatch;
create extension pg_trgm;

Usually with a sql file full of functions, it is something like this:

cat fuzzystrmatch.sql | psql {database name}
  • 2
    the problem is, where can I get that file?, it isn't in my system.
    – Alex. S.
    May 20, 2009 at 15:07
  • Ask the guys from "PostgreSQL for Mac". May 21, 2009 at 8:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .