ramnivas commented on code in PR #1608:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1608#discussion_r1890950917
##########
src/parser/mod.rs:
##########
@@ -6830,7 +6830,15 @@ impl<'a> Parser<'a> {
let columns = self.parse_parenthesized_column_list(Mandatory,
false)?;
self.expect_keyword(Keyword::REFERENCES)?;
let foreign_table = self.parse_object_name(false)?;
- let referred_columns =
self.parse_parenthesized_column_list(Mandatory, false)?;
+ // PostgreSQL allows foreign key columns to be optional
+ //
(https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-PARMS-REFERENCES)
+ let parenthesized_column_list_optional = if dialect_of!(self
is PostgreSqlDialect) {
Review Comment:
Good point. Made the change.
--
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]