LucaCappelletti94 commented on code in PR #2417:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2417#discussion_r4318352904


##########
src/parser/mod.rs:
##########
@@ -18677,6 +18674,102 @@ impl<'a> Parser<'a> {
         })
     }
 
+    /// Parse `ALTER DEFAULT PRIVILEGES`, whose keywords are already consumed.
+    ///
+    /// See [PostgreSQL 
docs](https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html).
+    pub fn parse_alter_default_privileges(
+        &mut self,
+    ) -> Result<AlterDefaultPrivileges, ParserError> {
+        // `FOR USER` is a synonym of `FOR ROLE` and is normalised to it.
+        let for_roles = if self.parse_keyword(Keyword::FOR) {
+            self.expect_one_of_keywords(&[Keyword::ROLE, Keyword::USER])?;
+            self.parse_comma_separated(|p| p.parse_identifier())?
+        } else {
+            vec![]
+        };
+
+        let in_schemas = if self.parse_keywords(&[Keyword::IN, 
Keyword::SCHEMA]) {

Review Comment:
   `FOR ROLE` and `IN SCHEMA` are now one ordered option list, so either order 
parses and prints as written, and repeatitions are rejected, as PostgreSQL does.



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