-
Notifications
You must be signed in to change notification settings - Fork 882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow DROP NOT NULL on column of compressed table #7455
base: main
Are you sure you want to change the base?
Allow DROP NOT NULL on column of compressed table #7455
Conversation
c5338ca
to
744ac62
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7455 +/- ##
==========================================
+ Coverage 80.06% 82.11% +2.04%
==========================================
Files 190 230 +40
Lines 37181 43095 +5914
Branches 9450 10830 +1380
==========================================
+ Hits 29770 35386 +5616
- Misses 2997 3391 +394
+ Partials 4414 4318 -96 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
It is actually fine to use |
75b8809
to
3bbca7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting NOT NULL
on a column which has compressed NULL values doesn't work properly. Maybe we should just limit this change to dropping NOT NULL
since setting requires decompression which isn't done in the current change.
Also, lets add a test for this, trying to set NOT NULL
on a column which has NULL values and the hypertable is full compressed (not partial).
This turned out to not be the case. If executed on a compressed chunk, it works for hypercore-compressed tables but not for heap-compressed tables. It seems like hypercore-compressed tables check for the presence of NULL using |
Yeah, I discovered that it does not work for compressed tables using the
There is an existing test in |
Could we get the simplest thing merged the |
3bbca7f
to
2964f82
Compare
Ok, split out the code to deal with |
Remove the restriction on `ALTER TABLE ... ALTER COLUMN DROP NOT NULL` on compressed hypertables. Dropping the `NOT NULL` constraint on a column of a compressed hypertable is safe since it does not require re-writing any data.
2964f82
to
601c367
Compare
Remove the restriction on
ALTER TABLE ... ALTER COLUMN SET/DROP NOT NULL
on compressed tables.Dropping or setting the
NOT NULL
constraint on a column of a compressed table is safe since it does not require re-writing any data. SettingNOT NULL
will require a full table scan to verify that there are no NULL in the table.Fixes #5776