Repository: tobymao/sqlglot

Issue:
Postgres opclass with schema prefix
**Before you file an issue**
In Postgres SQL opclass may include a schema prefix. Now I get an error when parsing such SQL. 

**Fully reproducible code snippet**
```python
    sql = """
    CREATE INDEX index_issues_on_title_trigram ON public.issues USING gin (title public.gin_trgm_ops);
    """
    parsed_sql_exprs = sqlglot.parse_one(sql, read="postgres")
```

**Official Documentation**
https://www.postgresql.org/docs/current/sql-createopclass.html


Discussion:

Patch:
diff --git a/sqlglot/parser.py b/sqlglot/parser.py
index 9aa2313c..3d9602b0 100644
--- a/sqlglot/parser.py
+++ b/sqlglot/parser.py
@@ -879,6 +879,7 @@ class Parser(metaclass=_Parser):
     CLONE_KINDS = {"TIMESTAMP", "OFFSET", "STATEMENT"}
 
     OPCLASS_FOLLOW_KEYWORDS = {"ASC", "DESC", "NULLS"}
+    OPTYPE_FOLLOW_TOKENS = {TokenType.COMMA, TokenType.R_PAREN}
 
     TABLE_INDEX_HINT_TOKENS = {TokenType.FORCE, TokenType.IGNORE, TokenType.USE}
 
@@ -2565,9 +2566,8 @@ class Parser(metaclass=_Parser):
         if self._match_texts(self.OPCLASS_FOLLOW_KEYWORDS, advance=False):
             return this
 
-        opclass = self._parse_var(any_token=True)
-        if opclass:
-            return self.expression(exp.Opclass, this=this, expression=opclass)
+        if not self._match_set(self.OPTYPE_FOLLOW_TOKENS, advance=False):
+            return self.expression(exp.Opclass, this=this, expression=self._parse_table_parts())
 
         return this
 


Test patch:
diff --git a/tests/dialects/test_postgres.py b/tests/dialects/test_postgres.py
index 0e5f1a1b..89360376 100644
--- a/tests/dialects/test_postgres.py
+++ b/tests/dialects/test_postgres.py
@@ -42,6 +42,9 @@ class TestPostgres(Validator):
         self.validate_identity(
             "CREATE INDEX foo ON bar.baz USING btree(col1 varchar_pattern_ops ASC, col2)"
         )
+        self.validate_identity(
+            "CREATE INDEX index_issues_on_title_trigram ON public.issues USING gin(title public.gin_trgm_ops)"
+        )
         self.validate_identity(
             "INSERT INTO x VALUES (1, 'a', 2.0) ON CONFLICT (id) DO NOTHING RETURNING *"
         )