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
posted @ 2019-10-09 10:39  RoyFans  阅读(2972)  评论(0编辑  收藏  举报