Skip to content

Allow SET NOT NULL on column of compressed table #7463

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

Merged

Conversation

mkindahl
Copy link
Member

@mkindahl mkindahl commented Nov 19, 2024

Since SET NOT NULL will only do a full table scan of the table to verify that there are no nulls, this should work without having to modify any data in the table. However, since the command does a table_beginscan it does not work for hypertables with compressed chunks that uses the heap table access method.

Disable-check: force-changelog-file

@mkindahl mkindahl self-assigned this Nov 19, 2024
@mkindahl mkindahl force-pushed the compressed-alter-column-set-not-null branch from da099bd to 8449949 Compare November 19, 2024 17:10
@mkindahl mkindahl marked this pull request as ready for review November 19, 2024 17:10
@mkindahl mkindahl force-pushed the compressed-alter-column-set-not-null branch from 8449949 to 71c08e1 Compare November 19, 2024 17:13
@mkindahl mkindahl requested a review from kpan2034 November 19, 2024 17:16
@mkindahl mkindahl force-pushed the compressed-alter-column-set-not-null branch from 71c08e1 to 8eb4f4e Compare November 19, 2024 17:18
@mkindahl mkindahl changed the title Compressed alter column set not null Allow SET NOT NULL on column of compressed table Nov 19, 2024
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.11%. Comparing base (59f50f2) to head (9fe71d9).
Report is 1009 commits behind head on main.

Files with missing lines Patch % Lines
src/process_utility.c 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7463      +/-   ##
==========================================
+ Coverage   80.06%   82.11%   +2.04%     
==========================================
  Files         190      230      +40     
  Lines       37181    43104    +5923     
  Branches     9450    10834    +1384     
==========================================
+ Hits        29770    35395    +5625     
- Misses       2997     3397     +400     
+ Partials     4414     4312     -102     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mkindahl mkindahl force-pushed the compressed-alter-column-set-not-null branch from 7a0ebc1 to 8caf04c Compare November 20, 2024 10:54
Copy link
Member

@erimatnor erimatnor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, but made some suggestions

@mkindahl mkindahl force-pushed the compressed-alter-column-set-not-null branch from 8caf04c to 6799243 Compare November 20, 2024 13:37
@fabriziomello fabriziomello added Compression ddl Issues that involve DDL handling labels Nov 20, 2024
@mkindahl mkindahl force-pushed the compressed-alter-column-set-not-null branch 2 times, most recently from 05d1e56 to 0b52822 Compare November 20, 2024 17:09
@mkindahl mkindahl force-pushed the compressed-alter-column-set-not-null branch from 0b52822 to 51c50c3 Compare November 20, 2024 17:46
@mkindahl mkindahl enabled auto-merge (rebase) November 20, 2024 17:47
Since `SET NOT NULL` will only do a full table scan of the table to
verify that there are no nulls, this should work without having to
modify any data in the table. However, it does not work for chunks
using the `heap` table access method if they are compressed since it
uses a normal table scan, so adding a check for this.
@mkindahl mkindahl force-pushed the compressed-alter-column-set-not-null branch from 51c50c3 to 9fe71d9 Compare November 20, 2024 18:50
@mkindahl mkindahl merged commit b1b2380 into timescale:main Nov 20, 2024
47 checks passed
@mkindahl mkindahl deleted the compressed-alter-column-set-not-null branch November 20, 2024 21:06
@akuzm akuzm added the released-2.18.0 Released in 2.18.0 label May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compression ddl Issues that involve DDL handling released-2.18.0 Released in 2.18.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants