Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gin_trgm_ops does not exist for access method "gin" #335

Closed
beckmx opened this issue Aug 22, 2016 · 12 comments
Closed

gin_trgm_ops does not exist for access method "gin" #335

beckmx opened this issue Aug 22, 2016 · 12 comments

Comments

@beckmx
Copy link

beckmx commented Aug 22, 2016

Hello, I have been working on a project that is shared by several members, and lately I cannot use my postgress installation for this problem:

PG::UndefinedObject: ERROR: operator class "gin_trgm_ops" does not exist for access method "gin"

Any ideas?

@tbussmann
Copy link
Member

seems you don't have the pg_trgm extension installed in the database in question. Try CREATE EXTENSION pg_trgm;

@sailing
Copy link

sailing commented Sep 16, 2016

Even with the extension installed, I still see this, on 9.4.9.1

@sailing
Copy link

sailing commented Sep 16, 2016

@beckmx, to clarify what @tbussmann responded, you need to \c to the database in question before running CREATE EXTENSION pg_trgm;

By default PostgresApp has you on your personal DB.

@quocgfy
Copy link

quocgfy commented Jan 16, 2017

Works great for me. thanks!

@jakob
Copy link
Member

jakob commented Jan 17, 2017

Glad it worked! Since there's nothing to do for us here, I'm closing this issue.

@jakob jakob closed this as completed Jan 17, 2017
@leandropadua
Copy link

Thanks for the solution. That worked partially for me. The full solution was to apply it to every schema by adding the schema pg_catalog to the end of it:
create extension pg_trgm with schema pg_catalog;

@maufranchini
Copy link

It worked for me as well, with another extension related to GIN (intarray). I needed to select the schema as @leandropadua mentioned.

create extension intarray with schema nameOfMySchema

@jiapei100
Copy link

@beckmx, to clarify what @tbussmann responded, you need to \c to the database in question before running CREATE EXTENSION pg_trgm;

By default PostgresApp has you on your personal DB.

Thank you so much....

@Que2701
Copy link

Que2701 commented Jul 1, 2022

@tbussmann works for me

@rulasmarmol
Copy link

In my case I already had the extension installed, but I created a new schema and it was not working with the new schema, so I had to drop the extension and create a new one specifying the schema and that work.

@lauksas
Copy link

lauksas commented Dec 5, 2023

In my case, some other script created the extension in a non-standard schema, thus the gin_trgm_ops was not being found.
I issued ALTER EXTENSION pg_trgm SET SCHEMA pg_catalog; to my script and it worked.
Hope that helps someone.

@alistairreynolds
Copy link

In my case it was a bit different. I was restoring using a dump file of a separate schema (not including the public schema), so when restoring into the target database where I'd already had the extension created, it could only create it on the public schema, not the new one. And I couldn't create the extension on the target schema because it hadn't been created yet (slightly chicken-egg).

Only real way around it was to re-create the extension on the target schema after it had finished reimporting, then re-adding the indexes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests