pgsql-ast-parser
pgsql-ast-parser copied to clipboard
`ALTER` statements with `USING expression` fail to parse
Parsing:
ALTER TABLE
foo ALTER bar TYPE opt USING bar::opt;
Fails with:
Error: Syntax error at line 2 col 26:
foo ALTER bar TYPE opt USING
^
Unexpected kw_using token: "using". Instead, I was expecting to see one of the following:
- A "dot" token
- A "lparen" token
- A "kw_array" token
- A "lbracket" token
- A "comma" token
- A "semicolon" token
at Parser.feed (/src/node_modules/nearley/lib/nearley.js:343:27)
at _parse (/src/node_modules/pgsql-ast-parser/src/parser.ts:110:16)
at doParse (/src/node_modules/pgsql-ast-parser/src/parser.ts:57:27)
at Object.parse (/src/node_modules/pgsql-ast-parser/src/parser.ts:60:11)