I'm trying to use contrib modules in the new Postgres 9 shared databases on Heroku. More specifically, the pg_trgm and fuzzystrmatch modules. In the documentation it says
In addition, many complimentary extensions are available such as fuzzystrmatch, pg_trgm, and unaccent.
I can't seem to find any documentation on HOW to actually enable these modules on a shared Heroku database. See answer below.
NOTE:
I tried adding them by connecting to the database with
heroku pg:psql HEROKU_POSTGRESQL_BROWN
and running
create extension pg_trgm
create extension fuzzystrmatch
but after trying to use it with
SELECT levenshtein('tests', 'test');
it still said
ERROR: function levenshtein(unknown, unknown) does not existLINE 1: SELECT levenshtein('tests', 'test');
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Anybody know why this happens?