Repository navigation
PostgreSQL: Support NOT NULL and NULL in CREATE DOMAIN - #2798
Open
LucaCappelletti94 wants to merge 7 commits into
Open
LucaCappelletti94 wants to merge 7 commits into
LucaCappelletti94 wants to merge 7 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## upstream/alter-domain #2798 +/- ##
======================================================
Coverage 83.15% 83.16%
======================================================
Files 42 42
Lines 36382 36399 +17
Branches 36382 36399 +17
======================================================
+ Hits 30255 30272 +17
Misses 2636 2636
Partials 3491 3491 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
upstream/create-domain-nullability
branch
from
November 2, 2026 13:04
6483aa6 to
f4a1d8d
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.
CREATE DOMAIN d AS INT NOT NULLfails withExpected: end of statement, found: NOT, andCREATE DOMAIN d AS INT NULLthe same way, becauseparse_create_domainreads its constraints withparse_optional_table_constraint, which knowsCHECKbut not the nullability spellings of a domain.CREATE DOMAIN d AS INT DEFAULT 0 NOT NULLdoes parse, but the default expression swallows theNOT NULLand prints back asDEFAULT 0 IS NOT NULL.CreateDomain.constraintsnow holds theDomainConstraintenum thatALTER DOMAIN ... ADDuses, with an addedNULLvariant, so[ CONSTRAINT name ] NOT NULL,NULLandCHECK (...)parse in any order and number, and table-only constraints such asPRIMARY KEYare refused.ALTER DOMAIN ... ADD NULLstays refused, as in PostgreSQL. The default expression is parsed in the column definition state that column defaults already use, so a trailingNOT NULLstays a constraint.