iffyio commented on code in PR #2214:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2214#discussion_r2833532056


##########
src/parser/mod.rs:
##########
@@ -17166,12 +17166,27 @@ impl<'a> Parser<'a> {
             let table = self.parse_keyword(Keyword::TABLE);
             let table_object = self.parse_table_object()?;
 
-            let table_alias =
-                if dialect_of!(self is PostgreSqlDialect) && 
self.parse_keyword(Keyword::AS) {
-                    Some(self.parse_identifier()?)
-                } else {
-                    None
-                };
+            let table_alias = if 
self.dialect.supports_insert_table_implicit_alias()

Review Comment:
   for oracle I imagine `AS` is a keyword - so that the following should be 
invalid query?
   
   ```sql
   INSERT INTO T as SELECT 1
   ```
   
   I don't think it would be necessarily problematic that the parser accepts 
the following
   
   ```sql
   INSERT INTO T AS alias SELECT 1; // oracle
   INSERT INTO T alias SELECT 1; // postgres
   ```
   
   since downstream crates can further validate if desired.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to