From 39616e838b1c540a7ed83b5243a980a9c21a4333 Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Tue, 13 Feb 2024 17:16:30 +0100 Subject: [PATCH] Release 2.14.1 This release contains bug fixes since the 2.14.0 release. We recommend that you upgrade at the next available opportunity. **Features** * #6630 Add views for per chunk compression settings **Bugfixes** * #6636 Fixes extension update of compressed hypertables with dropped columns * #6637 Reset sequence numbers on non-rollup compression * #6639 Disable default indexscan for compression * #6651 Fix DecompressChunk path generation with per chunk settings **Thanks** * @anajavi for reporting an issue with extension update of compressed hypertables --- .unreleased/pr_6630 | 1 - .unreleased/pr_6636 | 2 -- CHANGELOG.md | 19 +++++++++++- sql/CMakeLists.txt | 8 +++-- sql/updates/2.14.0--2.14.1.sql | 57 ++++++++++++++++++++++++++++++++++ sql/updates/2.14.1--2.14.0.sql | 4 +++ sql/updates/latest-dev.sql | 56 --------------------------------- sql/updates/reverse-dev.sql | 4 --- version.config | 6 ++-- 9 files changed, 87 insertions(+), 70 deletions(-) delete mode 100644 .unreleased/pr_6630 delete mode 100644 .unreleased/pr_6636 create mode 100644 sql/updates/2.14.0--2.14.1.sql create mode 100644 sql/updates/2.14.1--2.14.0.sql diff --git a/.unreleased/pr_6630 b/.unreleased/pr_6630 deleted file mode 100644 index 1f5774445c8..00000000000 --- a/.unreleased/pr_6630 +++ /dev/null @@ -1 +0,0 @@ -Implements: #6630 Add views for per chunk compression settings diff --git a/.unreleased/pr_6636 b/.unreleased/pr_6636 deleted file mode 100644 index a3520ba6655..00000000000 --- a/.unreleased/pr_6636 +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: #6636 Fixes extension update of compressed hypertables with dropped columns -Thanks: @anajavi for reporting an issue with extension update of compressed hypertables diff --git a/CHANGELOG.md b/CHANGELOG.md index 7af10b40ad1..a0f85a9a21e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ `psql` with the `-X` flag to prevent any `.psqlrc` commands from accidentally triggering the load of a previous DB version.** +## 2.14.1 (2024-02-14) + +This release contains bug fixes since the 2.14.0 release. +We recommend that you upgrade at the next available opportunity. + +**Features** +* #6630 Add views for per chunk compression settings + +**Bugfixes** +* #6636 Fixes extension update of compressed hypertables with dropped columns +* #6637 Reset sequence numbers on non-rollup compression +* #6639 Disable default indexscan for compression +* #6651 Fix DecompressChunk path generation with per chunk settings + +**Thanks** +* @anajavi for reporting an issue with extension update of compressed hypertables + ## 2.14.0 (2024-02-08) This release contains performance improvements and bug fixes since @@ -106,7 +123,7 @@ We recommend that you upgrade at the next available opportunity. This release contains performance improvements, an improved hypertable DDL API and bug fixes since the 2.12.2 release. We recommend that you upgrade at the next available opportunity. - + In addition, it includes these noteworthy features: * Full PostgreSQL 16 support for all existing features diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 3e51058aa52..6f241627bfe 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -43,11 +43,12 @@ set(MOD_FILES updates/2.12.1--2.12.2.sql updates/2.12.2--2.13.0.sql updates/2.13.0--2.13.1.sql - updates/2.13.1--2.14.0.sql) + updates/2.13.1--2.14.0.sql + updates/2.14.0--2.14.1.sql) # The downgrade file to generate a downgrade script for the current version, as # specified in version.config -set(CURRENT_REV_FILE 2.14.0--2.13.1.sql) +set(CURRENT_REV_FILE 2.14.1--2.14.0.sql) # Files for generating old downgrade scripts. This should only include files for # downgrade from one version to its previous version since we do not support # skipping versions when downgrading. @@ -82,7 +83,8 @@ set(OLD_REV_FILES 2.12.2--2.12.1.sql 2.13.0--2.12.2.sql 2.13.1--2.13.0.sql - 2.14.0--2.13.1.sql) + 2.14.0--2.13.1.sql + 2.14.1--2.14.0.sql) set(MODULE_PATHNAME "$libdir/timescaledb-${PROJECT_VERSION_MOD}") set(LOADER_PATHNAME "$libdir/timescaledb") diff --git a/sql/updates/2.14.0--2.14.1.sql b/sql/updates/2.14.0--2.14.1.sql new file mode 100644 index 00000000000..f22ea0d610e --- /dev/null +++ b/sql/updates/2.14.0--2.14.1.sql @@ -0,0 +1,57 @@ + +CREATE VIEW timescaledb_information.hypertable_compression_settings AS + SELECT + format('%I.%I',ht.schema_name,ht.table_name)::regclass AS hypertable, + array_to_string(segmentby,',') AS segmentby, + un.orderby, + d.compress_interval_length + FROM _timescaledb_catalog.hypertable ht + JOIN LATERAL ( + SELECT + CASE WHEN d.column_type = ANY(ARRAY['timestamp','timestamptz','date']::regtype[]) THEN + _timescaledb_functions.to_interval(d.compress_interval_length)::text + ELSE + d.compress_interval_length::text + END AS compress_interval_length + FROM _timescaledb_catalog.dimension d WHERE d.hypertable_id = ht.id ORDER BY id LIMIT 1 + ) d ON true + LEFT JOIN _timescaledb_catalog.compression_settings s ON format('%I.%I',ht.schema_name,ht.table_name)::regclass = s.relid + LEFT JOIN LATERAL ( + SELECT + string_agg( + format('%I%s%s',orderby, + CASE WHEN "desc" THEN ' DESC' ELSE '' END, + CASE WHEN nullsfirst AND NOT "desc" THEN ' NULLS FIRST' WHEN NOT nullsfirst AND "desc" THEN ' NULLS LAST' ELSE '' END + ) + ,',') AS orderby + FROM unnest(s.orderby, s.orderby_desc, s.orderby_nullsfirst) un(orderby, "desc", nullsfirst) + ) un ON true; + +CREATE VIEW timescaledb_information.chunk_compression_settings AS + SELECT + format('%I.%I',ht.schema_name,ht.table_name)::regclass AS hypertable, + format('%I.%I',ch.schema_name,ch.table_name)::regclass AS chunk, + array_to_string(segmentby,',') AS segmentby, + un.orderby + FROM _timescaledb_catalog.hypertable ht + INNER JOIN _timescaledb_catalog.chunk ch ON ch.hypertable_id = ht.id + INNER JOIN _timescaledb_catalog.chunk ch2 ON ch2.id = ch.compressed_chunk_id + LEFT JOIN _timescaledb_catalog.compression_settings s ON format('%I.%I',ch2.schema_name,ch2.table_name)::regclass = s.relid + LEFT JOIN LATERAL ( + SELECT + string_agg( + format('%I%s%s',orderby, + CASE WHEN "desc" THEN ' DESC' ELSE '' END, + CASE WHEN nullsfirst AND NOT "desc" THEN ' NULLS FIRST' WHEN NOT nullsfirst AND "desc" THEN ' NULLS LAST' ELSE '' END + ),',') AS orderby + FROM unnest(s.orderby, s.orderby_desc, s.orderby_nullsfirst) un(orderby, "desc", nullsfirst) + ) un ON true; + +INSERT INTO _timescaledb_catalog.compression_settings +SELECT + format('%I.%I',ch.schema_name,ch.table_name)::regclass,s.segmentby,s.orderby,s.orderby_desc,s.orderby_nullsfirst +FROM _timescaledb_catalog.hypertable ht1 +INNER JOIN _timescaledb_catalog.hypertable ht2 ON ht2.id = ht1.compressed_hypertable_id +INNER JOIN _timescaledb_catalog.compression_settings s ON s.relid = format('%I.%I',ht1.schema_name,ht1.table_name)::regclass +INNER JOIN _timescaledb_catalog.chunk ch ON ch.hypertable_id = ht2.id ON CONFLICT DO NOTHING; + diff --git a/sql/updates/2.14.1--2.14.0.sql b/sql/updates/2.14.1--2.14.0.sql new file mode 100644 index 00000000000..f4aa6e9ebd4 --- /dev/null +++ b/sql/updates/2.14.1--2.14.0.sql @@ -0,0 +1,4 @@ + +DROP VIEW IF EXISTS timescaledb_information.hypertable_compression_settings; +DROP VIEW IF EXISTS timescaledb_information.chunk_compression_settings; + diff --git a/sql/updates/latest-dev.sql b/sql/updates/latest-dev.sql index f22ea0d610e..8b137891791 100644 --- a/sql/updates/latest-dev.sql +++ b/sql/updates/latest-dev.sql @@ -1,57 +1 @@ -CREATE VIEW timescaledb_information.hypertable_compression_settings AS - SELECT - format('%I.%I',ht.schema_name,ht.table_name)::regclass AS hypertable, - array_to_string(segmentby,',') AS segmentby, - un.orderby, - d.compress_interval_length - FROM _timescaledb_catalog.hypertable ht - JOIN LATERAL ( - SELECT - CASE WHEN d.column_type = ANY(ARRAY['timestamp','timestamptz','date']::regtype[]) THEN - _timescaledb_functions.to_interval(d.compress_interval_length)::text - ELSE - d.compress_interval_length::text - END AS compress_interval_length - FROM _timescaledb_catalog.dimension d WHERE d.hypertable_id = ht.id ORDER BY id LIMIT 1 - ) d ON true - LEFT JOIN _timescaledb_catalog.compression_settings s ON format('%I.%I',ht.schema_name,ht.table_name)::regclass = s.relid - LEFT JOIN LATERAL ( - SELECT - string_agg( - format('%I%s%s',orderby, - CASE WHEN "desc" THEN ' DESC' ELSE '' END, - CASE WHEN nullsfirst AND NOT "desc" THEN ' NULLS FIRST' WHEN NOT nullsfirst AND "desc" THEN ' NULLS LAST' ELSE '' END - ) - ,',') AS orderby - FROM unnest(s.orderby, s.orderby_desc, s.orderby_nullsfirst) un(orderby, "desc", nullsfirst) - ) un ON true; - -CREATE VIEW timescaledb_information.chunk_compression_settings AS - SELECT - format('%I.%I',ht.schema_name,ht.table_name)::regclass AS hypertable, - format('%I.%I',ch.schema_name,ch.table_name)::regclass AS chunk, - array_to_string(segmentby,',') AS segmentby, - un.orderby - FROM _timescaledb_catalog.hypertable ht - INNER JOIN _timescaledb_catalog.chunk ch ON ch.hypertable_id = ht.id - INNER JOIN _timescaledb_catalog.chunk ch2 ON ch2.id = ch.compressed_chunk_id - LEFT JOIN _timescaledb_catalog.compression_settings s ON format('%I.%I',ch2.schema_name,ch2.table_name)::regclass = s.relid - LEFT JOIN LATERAL ( - SELECT - string_agg( - format('%I%s%s',orderby, - CASE WHEN "desc" THEN ' DESC' ELSE '' END, - CASE WHEN nullsfirst AND NOT "desc" THEN ' NULLS FIRST' WHEN NOT nullsfirst AND "desc" THEN ' NULLS LAST' ELSE '' END - ),',') AS orderby - FROM unnest(s.orderby, s.orderby_desc, s.orderby_nullsfirst) un(orderby, "desc", nullsfirst) - ) un ON true; - -INSERT INTO _timescaledb_catalog.compression_settings -SELECT - format('%I.%I',ch.schema_name,ch.table_name)::regclass,s.segmentby,s.orderby,s.orderby_desc,s.orderby_nullsfirst -FROM _timescaledb_catalog.hypertable ht1 -INNER JOIN _timescaledb_catalog.hypertable ht2 ON ht2.id = ht1.compressed_hypertable_id -INNER JOIN _timescaledb_catalog.compression_settings s ON s.relid = format('%I.%I',ht1.schema_name,ht1.table_name)::regclass -INNER JOIN _timescaledb_catalog.chunk ch ON ch.hypertable_id = ht2.id ON CONFLICT DO NOTHING; - diff --git a/sql/updates/reverse-dev.sql b/sql/updates/reverse-dev.sql index f4aa6e9ebd4..e69de29bb2d 100644 --- a/sql/updates/reverse-dev.sql +++ b/sql/updates/reverse-dev.sql @@ -1,4 +0,0 @@ - -DROP VIEW IF EXISTS timescaledb_information.hypertable_compression_settings; -DROP VIEW IF EXISTS timescaledb_information.chunk_compression_settings; - diff --git a/version.config b/version.config index 9122968bf5d..aefa3391209 100644 --- a/version.config +++ b/version.config @@ -1,3 +1,3 @@ -version = 2.14.0 -update_from_version = 2.13.1 -downgrade_to_version = 2.13.1 +version = 2.14.1 +update_from_version = 2.14.0 +downgrade_to_version = 2.14.0