g_trgm
is an extension, so:sql
CREATE EXTENSION pg_trgm;
If you get the following errorpost
ERROR: could not open extension control file ".../extension/pg_trgm.control":
No such file or directory"postgresql
then you need to install the module for your operating systemcode
Ubuntu/Debian:get
sudo apt install postgresql-contrib
Redhat/Centosio
sudo yum install postgresql10-contrib
Fedoramodule
sudo dnf install postgresql-contrib