GlareDB / glaredb

GlareDB: An analytics DBMS for distributed data
https://glaredb.com
GNU Affero General Public License v3.0
579 stars 37 forks source link

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

Open talagluck opened 3 months ago

talagluck commented 3 months ago

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.

vrongmeal commented 2 months ago

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 commented 2 months ago

upstream issue: https://github.com/sqlparser-rs/sqlparser-rs/issues/892