pganalyze / pg_query

Ruby extension to parse, deparse and normalize SQL queries using the PostgreSQL query parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`ALTER INDEX name` is wrongly parsed

ayufan opened this issue · comments

The following index generates wrong .tables:

PgQuery.parse("ALTER INDEX index_name SET (fastupdate = on);").tables
=> ["index_name"]
PgQuery.parse("ALTER INDEX index_name SET (fastupdate = on);").ddl_tables
=> ["index_name"]

It is expected to be [] instead.

Interestingly the ALTER INDEX index_on_projects RENAME TO some_index is parsed differently, which means that this is parsing problem, and maybe the fix should be made there instead.