Skip to content
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

Fix adding column with NULL constraint #5152

Conversation

fabriziomello
Copy link
Contributor

Adding new column with NULL constraint to a compressed hypertable is raising an error but it make no sense because NULL constraints in Postgres does nothing, I mean it is useless and exist just for compatibility with other database systems:
https://www.postgresql.org/docs/current/ddl-constraints.html#id-1.5.4.6.6

Fixed it by ignoring the NULL constraints when we check for ALTER TABLE .. ADD COLUMN .. to a compressed hypertable.

Fixes #5151

@github-actions
Copy link

github-actions bot commented Jan 5, 2023

@akuzm, @svenklemm: please review this pull request.

Powered by pull-review

Adding new column with NULL constraint to a compressed hypertable is
raising an error but it make no sense because NULL constraints in
Postgres does nothing, I mean it is useless and exist just for
compatibility with other database systems:
https://www.postgresql.org/docs/current/ddl-constraints.html#id-1.5.4.6.6

Fixed it by ignoring the NULL constraints when we check for `ALTER TABLE
.. ADD COLUMN ..` to a compressed hypertable.

Fixes timescale#5151
@fabriziomello fabriziomello force-pushed the fix_adding_column_with_null_constraint_to_compressed_hypertable branch from ee1a2c3 to 401f81b Compare January 5, 2023 19:12
@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Merging #5152 (401f81b) into main (1751efb) will decrease coverage by 0.02%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5152      +/-   ##
==========================================
- Coverage   89.46%   89.43%   -0.03%     
==========================================
  Files         227      227              
  Lines       51615    51616       +1     
==========================================
- Hits        46175    46161      -14     
- Misses       5440     5455      +15     
Impacted Files Coverage Δ
src/process_utility.c 90.17% <50.00%> (-0.04%) ⬇️
src/loader/bgw_launcher.c 89.51% <0.00%> (-2.55%) ⬇️
src/loader/bgw_message_queue.c 86.36% <0.00%> (-2.28%) ⬇️
tsl/src/reorder.c 85.87% <0.00%> (-0.23%) ⬇️
tsl/src/bgw_policy/job.c 87.28% <0.00%> (-0.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1751efb...401f81b. Read the comment docs.

@fabriziomello fabriziomello merged commit 41d6a1f into timescale:main Jan 6, 2023
@fabriziomello fabriziomello added this to the TimescaleDB 2.9.2 milestone Jan 17, 2023
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 18, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5180 Fix dist_cagg flaky test
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5172 Remove parallel safe from partialize_agg
* timescale#5162 Fix telemetry_stats test in PG15
* timescale#5130 Fix CAgg on CAgg variable bucket size validation
* timescale#5133 Fix CAgg on CAgg different column order
* timescale#5152 Fix adding column with NULL constraint
* timescale#5136 Fix SELECT from partial compressed chunks
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
@sb230132 sb230132 mentioned this pull request Jan 18, 2023
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 18, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5180 Fix dist_cagg flaky test
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5172 Remove parallel safe from partialize_agg
* timescale#5162 Fix telemetry_stats test in PG15
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5136 Fix SELECT from partial compressed chunks
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 19, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5180 Fix dist_cagg flaky test
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5172 Remove parallel safe from partialize_agg
* timescale#5162 Fix telemetry_stats test in PG15
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5136 Fix SELECT from partial compressed chunks
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
* timescale#5193 Fix repartition behavior when attaching data node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 19, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5180 Fix dist_cagg flaky test
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
* timescale#5193 Fix repartition behavior when attaching data node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 19, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5180 Fix dist_cagg flaky test
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
* timescale#5193 Fix repartition behavior when attaching data node
@sb230132 sb230132 mentioned this pull request Jan 19, 2023
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 19, 2023
Release 2.9.2

This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5180 Fix default data node availability status
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
* timescale#5193 Fix repartition behavior when attaching data node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 19, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5180 Fix default data node availability status
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
* timescale#5193 Fix repartition behavior when attaching data node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 20, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5133 Fix CAgg on CAgg using different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5180 Fix default data node availability status
* timescale#5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* timescale#5193 Fix repartition behavior when attaching data node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 23, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5114 Fix issue with deleting data node and dropping the database on multi-node
* timescale#5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5180 Fix default data node availability status on multi-node
* timescale#5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* timescale#5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 23, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5114 Fix issue with deleting data node and dropping the database on multi-node
* timescale#5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5180 Fix default data node availability status on multi-node
* timescale#5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* timescale#5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 23, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 24, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 24, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 24, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 24, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 24, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Adding column to compressed table fails if NULL is used as constraint
3 participants