LucaCappelletti94 opened a new pull request, #3024:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/3024

   PostgreSQL 15 onwards [lets `ON DELETE SET NULL` and `ON DELETE SET DEFAULT` 
name the columns they 
reset](https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-PARMS-REFERENCES),
 so `CREATE TABLE c (a INT, b INT, FOREIGN KEY (a, b) REFERENCES r ON DELETE 
SET NULL (b))` clears only `b`. The parser stopped after `SET NULL` and failed 
with `Expected: ',' or ')' after column definition, found: (`, and the same 
happened for column-level `REFERENCES` and for `ALTER TABLE ... ADD FOREIGN 
KEY`.
   
   This PR gives `ReferentialAction::SetNull` and `SetDefault` a `Vec<Ident>`, 
empty when no list is written, so the enum is no longer `Copy`. The list is 
also accepted after `ON UPDATE`, because PostgreSQL's grammar takes it there 
and only rejects it during analysis.


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

  • [PR] PostgreSQL: Support column ... LucaCappelletti94 (via GitHub) via github

Reply via email to