-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot parse table alias or cte alias in Postgres dialect #1069
Comments
It would be great to figure out what is going on here and add the relevant support |
I'm interested in working on this issue. So adding these lines of code under https://github.com/sqlparser-rs/sqlparser-rs/blob/main/src/parser/mod.rs#L7459
will cause both of the insert statements above to parse without error. The problem is then that the Statement::Insert uses the type ObjectName for table_name. My first thought is to add a table_alias field to Insert, and not change the type of table_name. Do others have thoughts on where to store the alias field? |
I wonder if it would be apprpriate to use IdentWithAlias instead of |
So wrt IdentWithAlias I have only seen that being used for column renames ( select foo as bar from table ) because of the possibility of referring to a table with a dot between schema and table (public.table) the ObjectName is a Vec of Idents. I looked at at Statement::Delete and Statement::Update which currently handle table aliases by using TableWithJoins. I think the least disruptive change is to add I'll have a PR up shortly. |
Sorry for bothering you.
I'm using sqlparser = "0.40.0"
This is my code:
error output:
Thank you!
The text was updated successfully, but these errors were encountered: