postgresql 创建索引:ERROR: operator class "gin_trgm_ops" does not exist for access method "gin"

g_trgm is an extension, so:

CREATE EXTENSION pg_trgm;

If you get the following error

ERROR: could not open extension control file ".../extension/pg_trgm.control":
No such file or directory"

then you need to install the module for your operating system

  • Ubuntu/Debian:

    sudo apt install postgresql-contrib
    
  • Redhat/Centos

    sudo yum install postgresql10-contrib
    
  • Fedora

    sudo dnf install postgresql-contrib
原文地址:https://www.cnblogs.com/royfans/p/11640299.html