-
Notifications
You must be signed in to change notification settings - Fork 884
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
[Bug]: Adding column to compressed table fails if NULL is used as constraint #5151
Comments
Good catch @ikkala! Thanks for reporting, providing a fix for it! |
fabriziomello
added a commit
to fabriziomello/timescaledb
that referenced
this issue
Jan 5, 2023
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
added a commit
to fabriziomello/timescaledb
that referenced
this issue
Jan 5, 2023
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
Thanks! Background, why this popped up in the first place: I use DBeaver sometimes to generate DDL for changes like the ones in this issue, and DBeaver by default put that dummy NULL there. |
fabriziomello
added a commit
that referenced
this issue
Jan 6, 2023
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
sb230132
pushed a commit
that referenced
this issue
Jan 23, 2023
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
sb230132
pushed a commit
that referenced
this issue
Jan 24, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What type of bug is this?
Incorrect result, Unexpected error
What subsystems and features are affected?
Command processing, Compression
What happened?
Following error occur in case of the following statement:
On the other hand, following works:
ALTER TABLE table1 ADD COLUMN column1 jsonb;
TimescaleDB version affected
2.8.1
PostgreSQL version used
13.9
What operating system did you use?
Docker image timescale/timescaledb-ha:pg13.9-ts2.8.1-p3
What installation method did you use?
Docker
What platform did you run on?
On prem/Self-hosted
Relevant log output and stack trace
No response
How can we reproduce the bug?
The text was updated successfully, but these errors were encountered: