I have a postgres function called 'medrealize()' inside which i am creating temp table and creating index for temp tables using below lines
CREATE INDEX SQLOPS_RefICD_ICD10_idx ON t$SQLOPS_RefICD_ICD10 USING gist (code gist_trgm_ops );
CREATE INDEX regexes_idx ON t$regexes USING gist (icdregex gist_trgm_ops );
When calling the function from pgadmin, the function runs without any issues. But when calling the function from python using
cursor.execute("BEGIN")
cursor.execute("CALL medrealize();")
cursor.execute("COMMIT")
I am getting below error
operator class \"gist_trgm_ops\" does not exist for access method \"gist\"\
Any idea why its running fine when calling from PgAdmin and raising error when calling from Python?