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


##########
src/parser/mod.rs:
##########
@@ -5108,14 +5108,18 @@ impl<'a> Parser<'a> {
         let temporary = self
             .parse_one_of_keywords(&[Keyword::TEMP, Keyword::TEMPORARY])
             .is_some();
+        let unlogged = dialect_of!(self is PostgreSqlDialect | GenericDialect)
+            && self.parse_keyword(Keyword::UNLOGGED);

Review Comment:
   is there a requirement to use a dialect guard? if not we can always accept 
the syntax 



##########
src/parser/mod.rs:
##########
@@ -5108,14 +5108,18 @@ impl<'a> Parser<'a> {
         let temporary = self
             .parse_one_of_keywords(&[Keyword::TEMP, Keyword::TEMPORARY])
             .is_some();
+        let unlogged = dialect_of!(self is PostgreSqlDialect | GenericDialect)
+            && self.parse_keyword(Keyword::UNLOGGED);
         let persistent = dialect_of!(self is DuckDbDialect)
             && self.parse_one_of_keywords(&[Keyword::PERSISTENT]).is_some();
         let create_view_params = self.parse_create_view_params()?;
         if self.peek_keywords(&[Keyword::SNAPSHOT, Keyword::TABLE]) {
             self.parse_create_snapshot_table().map(Into::into)
         } else if self.parse_keyword(Keyword::TABLE) {
-            self.parse_create_table(or_replace, temporary, global, transient)
+            self.parse_create_table(or_replace, temporary, unlogged, global, 
transient)
                 .map(Into::into)
+        } else if unlogged {
+            self.expected_ref("TABLE after UNLOGGED", self.peek_token_ref())

Review Comment:
   I think this shouldn't be needed, the else branch covers the scenario where 
there is no match?



-- 
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