how to install fuzzystrmatch.sql pg_trgm.sql on postgresql on mac os x

26,759

Solution 1

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

Solution 2

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.

Solution 3

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

Solution 4

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

create extension fuzzystrmatch;
create extension pg_trgm;

Solution 5

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

cat fuzzystrmatch.sql | psql {database name}
Share:
26,759

Related videos on Youtube

Alex. S.
Author by

Alex. S.

Developer and IT and stuff.

Updated on September 17, 2022

Comments

  • Alex. S.
    Alex. S. almost 2 years

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

  • Alex. S.
    Alex. S. about 15 years
    the problem is, where can I get that file?, it isn't in my system.
  • Milen A. Radev
    Milen A. Radev about 15 years
    Ask the guys from "PostgreSQL for Mac".
  • Clinton Blackmore
    Clinton Blackmore about 15 years
    For me, it was in /Library/PostgresPlus/8.3/share/contrib .