10

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

4

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 . – Clinton Blackmore Jun 10 '09 at 23:31
24

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;

Done.

7

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
3

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

create extension fuzzystrmatch;
create extension pg_trgm;
1

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 '09 at 15:07
  • Ask the guys from "PostgreSQL for Mac". – Milen A. Radev May 21 '09 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.