Skip to content

Commit

Permalink
Feat(parser): add support for ALTER INDEX closes #4105
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas committed Sep 10, 2024
1 parent cb5bcff commit f8d4dc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions sqlglot/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ class Parser(metaclass=_Parser):
}

ALTERABLES = {
TokenType.INDEX,
TokenType.TABLE,
TokenType.VIEW,
}
Expand Down
1 change: 1 addition & 0 deletions tests/dialects/test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ def test_ddl(self):
cdef.args["kind"].assert_is(exp.DataType)
self.assertEqual(expr.sql(dialect="postgres"), "CREATE TABLE t (x INTERVAL DAY)")

self.validate_identity('ALTER INDEX "IX_Ratings_Column1" RENAME TO "IX_Ratings_Column2"')
self.validate_identity('CREATE TABLE x (a TEXT COLLATE "de_DE")')
self.validate_identity('CREATE TABLE x (a TEXT COLLATE pg_catalog."default")')
self.validate_identity("CREATE TABLE t (col INT[3][5])")
Expand Down

0 comments on commit f8d4dc4

Please sign in to comment.