sabir-akhadov-localstack commented on code in PR #2834:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2834#discussion_r4658292190


##########
src/parser/mod.rs:
##########
@@ -980,6 +981,17 @@ impl<'a> Parser<'a> {
             Token::Word(w) if w.keyword == Keyword::COLUMN => {
                 (CommentObject::Column, self.parse_object_name(false)?)
             }
+            Token::Word(w) if w.keyword == Keyword::CONSTRAINT => {
+                let name = ObjectName::from(vec![self.parse_identifier()?]);
+                self.expect_keyword_is(Keyword::ON)?;
+                let object_type = if self.parse_keyword(Keyword::DOMAIN) {

Review Comment:
   `DOMAIN` is non-reserved, so PG 16 accepts `COMMENT ON CONSTRAINT c ON 
domain IS 'x'` and `... ON domain.t IS 'x'` as table constraints; here both 
fail because `DOMAIN` is consumed as the keyword. Could treat it as the keyword 
only when the next token is not `IS` or `.`.



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

  • Re: [PR] PostgreSQL: Supp... sabir-akhadov-localstack (via GitHub) via github

Reply via email to