Repository navigation
PostgreSQL: Support ALTER DOMAIN - #2796
Open
LucaCappelletti94 wants to merge 5 commits into
Open
LucaCappelletti94 wants to merge 5 commits into
LucaCappelletti94 wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2796 +/- ##
==========================================
+ Coverage 83.09% 83.14% +0.05%
==========================================
Files 42 42
Lines 36261 36358 +97
Branches 36261 36358 +97
==========================================
+ Hits 30130 30231 +101
Misses 2636 2636
+ Partials 3495 3491 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
upstream/alter-domain
branch
from
November 2, 2026 13:04
88772a9 to
ebec3bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ALTER DOMAIN d1 SET DEFAULT 0, and every other form of the statement, fails withExpected: one of VIEW or TYPE or COLLATION or TABLE ..., found: DOMAIN, becauseparse_alterhas noDOMAINarm.Statement::AlterDomainnow wraps anAlterDomainstruct holding the domain name and anAlterDomainOperation, the shapeAlterCollationalready uses, and covers all eleven operations in the PostgreSQL grammar. A domain constraint can only beNOT NULLorCHECK, soADDparses into a newDomainConstraintenum with those two variants, andALTER DOMAIN d ADD PRIMARY KEY (VALUE)is refused as PostgreSQL refuses it. TheCHECKbody parsing moves into a helper that table constraints share. LikeCREATE DOMAINandALTER 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.