Skip to content
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

Allow parenthesis for INSERT INTO (SELECT *); statements #2858

Open
talagluck opened this issue Apr 5, 2024 · 2 comments
Open

Allow parenthesis for INSERT INTO (SELECT *); statements #2858

talagluck opened this issue Apr 5, 2024 · 2 comments
Labels
syntax Issues or features related to our SQL syntax upstream 🌊 Issues caused by upstream dependencies

Comments

@talagluck
Copy link
Contributor

talagluck commented Apr 5, 2024

Description

I would expect this to work:

insert into my_table
(select * from my_other_table)

It currently doesn't work with the parentheses. This will work though:

insert into my_table
select * from my_other_table

I've hit this issue on my own a few times - I wouldn't expect parentheses would break the insert statement, and I use parentheses pretty freely in my queries. It's also a problem when using incremental tables with dbt using the dbt postgres-adapter, since it automatically compiles the dbt model using parentheses.

@talagluck talagluck added the bug 🐛 Something isn't working label Apr 5, 2024
@talagluck talagluck changed the title Bug: Parenthesis don't work with SELECT statements Bug: Parenthesis don't work with SELECT statements in inserts Apr 5, 2024
@tychoish tychoish added syntax Issues or features related to our SQL syntax and removed bug 🐛 Something isn't working labels Apr 9, 2024
@tychoish tychoish changed the title Bug: Parenthesis don't work with SELECT statements in inserts Allow parenthesis for INSERT INTO (SELECT *); statements Apr 9, 2024
@vrongmeal
Copy link
Contributor

This would be a change in the sqlparser crate. Not sure if there's an open issue for this. I couldn't find one though.

@universalmind303 universalmind303 added the upstream 🌊 Issues caused by upstream dependencies label Apr 23, 2024
@universalmind303
Copy link
Contributor

upstream issue: sqlparser-rs/sqlparser-rs#892

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
syntax Issues or features related to our SQL syntax upstream 🌊 Issues caused by upstream dependencies
Projects
None yet
Development

No branches or pull requests

4 participants