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

   `ALTER DOMAIN d1 SET DEFAULT 0`, and every other form of the statement, 
fails with `Expected: one of VIEW or TYPE or COLLATION or TABLE ..., found: 
DOMAIN`, because `parse_alter` has no [`DOMAIN` 
arm](https://www.postgresql.org/docs/current/sql-alterdomain.html).
   
   `Statement::AlterDomain` now wraps an `AlterDomain` struct holding the 
domain name and an `AlterDomainOperation`, the shape `AlterCollation` already 
uses, and covers all eleven operations in the PostgreSQL grammar. A domain 
constraint can only be `NOT NULL` or `CHECK`, so `ADD` parses into a new 
`DomainConstraint` enum with those two variants, and `ALTER DOMAIN d ADD 
PRIMARY KEY (VALUE)` is refused as PostgreSQL refuses it. The `CHECK` body 
parsing moves into a helper that table constraints share. Like `CREATE DOMAIN` 
and `ALTER COLLATION`, the statement is not gated on the dialect.
   
   I reckon one very api breaking thing we might want to do at some point is to 
group the statements by things like Drop, Alter, Create and so on.


-- 
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 `ALTER ... LucaCappelletti94 (via GitHub) via github

Reply via email to