From 071284ffe977ce36437da3240ac31a433c509b50 Mon Sep 17 00:00:00 2001 From: Pallavi Sontakke Date: Fri, 13 Dec 2024 17:11:33 +0530 Subject: [PATCH] ## 2.18.0 This release contains performance improvements and bug fixes since the 2.17.2 release. We recommend that you upgrade at the next available opportunity. **Features** * #6901 Add hypertable support for transition tables * #7104 Hypercore table access method * #7271 Push down ORDER BY in real time continuous aggregate queries * #7295: Support ALTER TABLE SET ACCESS METHOD on hypertable. * #7390 Disable custom hashagg planner code * #7411 Change parameter name to enable Hypercore TAM * #7412 Add GUC for hypercore_use_access_method default * #7413: Add GUC for segmentwise recompression. * #7443 Add Hypercore function and view aliases * #7455: Support DROP NOT NULL on compressed hypertables * #7486 Prevent building against postgres versions with broken ABI **Bugfixes** * #7378 Remove obsolete job referencing policy_job_error_retention * #7409 Update bgw job table when altering procedure * #7410 "aggregated compressed column not found" error on aggregation query. * #7426 Fix datetime parsing error in chunk constraint creation * #7432 Verify that heap tuple is valid before using * #7434 Fixes segfault when internally set the replica identity for a given chunk * #7488 Emit error for transition table trigger on chunks * #7514 Fix error: invalid child of chunk append **Thanks** * @bharrisau for reporting the segfault when creating chunks * @pgloader for reporting an issue an internal background job * @uasiddiqi for reporting the "aggregated compressed column not found" error. --- .unreleased/pr_6901 | 1 - .unreleased/pr_7104 | 1 - .unreleased/pr_7271 | 1 - .unreleased/pr_7295 | 1 - .unreleased/pr_7378 | 2 - .unreleased/pr_7390 | 1 - .unreleased/pr_7409 | 1 - .unreleased/pr_7411 | 1 - .unreleased/pr_7412 | 1 - .unreleased/pr_7413 | 1 - .unreleased/pr_7426 | 1 - .unreleased/pr_7432 | 1 - .unreleased/pr_7434 | 2 - .unreleased/pr_7443 | 1 - .unreleased/pr_7455 | 1 - .unreleased/pr_7486 | 1 - .unreleased/pr_7488 | 1 - .unreleased/pr_7514 | 1 - .unreleased/resolve-vars | 2 - CHANGELOG.md | 36 ++++++++++ sql/CMakeLists.txt | 8 ++- sql/updates/2.17.2--2.18.0.sql | 116 +++++++++++++++++++++++++++++++++ sql/updates/2.18.0--2.17.2.sql | 59 +++++++++++++++++ sql/updates/latest-dev.sql | 116 --------------------------------- sql/updates/reverse-dev.sql | 59 ----------------- version.config | 2 +- 26 files changed, 217 insertions(+), 201 deletions(-) delete mode 100644 .unreleased/pr_6901 delete mode 100644 .unreleased/pr_7104 delete mode 100644 .unreleased/pr_7271 delete mode 100644 .unreleased/pr_7295 delete mode 100644 .unreleased/pr_7378 delete mode 100644 .unreleased/pr_7390 delete mode 100644 .unreleased/pr_7409 delete mode 100644 .unreleased/pr_7411 delete mode 100644 .unreleased/pr_7412 delete mode 100644 .unreleased/pr_7413 delete mode 100644 .unreleased/pr_7426 delete mode 100644 .unreleased/pr_7432 delete mode 100644 .unreleased/pr_7434 delete mode 100644 .unreleased/pr_7443 delete mode 100644 .unreleased/pr_7455 delete mode 100644 .unreleased/pr_7486 delete mode 100644 .unreleased/pr_7488 delete mode 100644 .unreleased/pr_7514 delete mode 100644 .unreleased/resolve-vars create mode 100644 sql/updates/2.17.2--2.18.0.sql create mode 100644 sql/updates/2.18.0--2.17.2.sql diff --git a/.unreleased/pr_6901 b/.unreleased/pr_6901 deleted file mode 100644 index 6a8c0583b05..00000000000 --- a/.unreleased/pr_6901 +++ /dev/null @@ -1 +0,0 @@ -Implements: #6901 Add hypertable support for transition tables diff --git a/.unreleased/pr_7104 b/.unreleased/pr_7104 deleted file mode 100644 index 049b5c5a340..00000000000 --- a/.unreleased/pr_7104 +++ /dev/null @@ -1 +0,0 @@ -Implements: #7104 Hypercore table access method diff --git a/.unreleased/pr_7271 b/.unreleased/pr_7271 deleted file mode 100644 index 813c8a2c138..00000000000 --- a/.unreleased/pr_7271 +++ /dev/null @@ -1 +0,0 @@ -Implements: #7271 Push down ORDER BY in real time continuous aggregate queries diff --git a/.unreleased/pr_7295 b/.unreleased/pr_7295 deleted file mode 100644 index d2ba054fee6..00000000000 --- a/.unreleased/pr_7295 +++ /dev/null @@ -1 +0,0 @@ -Implements: #7295: Support ALTER TABLE SET ACCESS METHOD on hypertable. diff --git a/.unreleased/pr_7378 b/.unreleased/pr_7378 deleted file mode 100644 index cbcfc137db0..00000000000 --- a/.unreleased/pr_7378 +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: #7378 Remove obsolete job referencing policy_job_error_retention -Thanks: @pgloader for reporting an issue an internal background job diff --git a/.unreleased/pr_7390 b/.unreleased/pr_7390 deleted file mode 100644 index 475f03f7fcd..00000000000 --- a/.unreleased/pr_7390 +++ /dev/null @@ -1 +0,0 @@ -Implements: #7390 Disable custom hashagg planner code diff --git a/.unreleased/pr_7409 b/.unreleased/pr_7409 deleted file mode 100644 index 9666dbbc82c..00000000000 --- a/.unreleased/pr_7409 +++ /dev/null @@ -1 +0,0 @@ -Fixes: #7409 Update bgw job table when altering procedure diff --git a/.unreleased/pr_7411 b/.unreleased/pr_7411 deleted file mode 100644 index 0068b46e06d..00000000000 --- a/.unreleased/pr_7411 +++ /dev/null @@ -1 +0,0 @@ -Implements: #7411 Change parameter name to enable Hypercore TAM diff --git a/.unreleased/pr_7412 b/.unreleased/pr_7412 deleted file mode 100644 index d978a7bc9d1..00000000000 --- a/.unreleased/pr_7412 +++ /dev/null @@ -1 +0,0 @@ -Implements: #7412 Add GUC for hypercore_use_access_method default diff --git a/.unreleased/pr_7413 b/.unreleased/pr_7413 deleted file mode 100644 index 53f2a223bae..00000000000 --- a/.unreleased/pr_7413 +++ /dev/null @@ -1 +0,0 @@ -Implements: #7413: Add GUC for segmentwise recompression. diff --git a/.unreleased/pr_7426 b/.unreleased/pr_7426 deleted file mode 100644 index e9841a1111f..00000000000 --- a/.unreleased/pr_7426 +++ /dev/null @@ -1 +0,0 @@ -Fixes: #7426 Fix datetime parsing error in chunk constraint creation diff --git a/.unreleased/pr_7432 b/.unreleased/pr_7432 deleted file mode 100644 index b8ffb610987..00000000000 --- a/.unreleased/pr_7432 +++ /dev/null @@ -1 +0,0 @@ -Fixes: #7432 Verify that heap tuple is valid before using diff --git a/.unreleased/pr_7434 b/.unreleased/pr_7434 deleted file mode 100644 index e2dd46382d9..00000000000 --- a/.unreleased/pr_7434 +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: #7434 Fixes segfault when internally set the replica identity for a given chunk -Thanks: @bharrisau for reporting the segfault when creating chunks diff --git a/.unreleased/pr_7443 b/.unreleased/pr_7443 deleted file mode 100644 index 7196037db05..00000000000 --- a/.unreleased/pr_7443 +++ /dev/null @@ -1 +0,0 @@ -Implements: #7443 Add Hypercore function and view aliases diff --git a/.unreleased/pr_7455 b/.unreleased/pr_7455 deleted file mode 100644 index 7f5a2f2429a..00000000000 --- a/.unreleased/pr_7455 +++ /dev/null @@ -1 +0,0 @@ -Implements: #7455: Support DROP NOT NULL on compressed hypertables diff --git a/.unreleased/pr_7486 b/.unreleased/pr_7486 deleted file mode 100644 index 81f763e08d3..00000000000 --- a/.unreleased/pr_7486 +++ /dev/null @@ -1 +0,0 @@ -Implements: #7486 Prevent building against postgres versions with broken ABI diff --git a/.unreleased/pr_7488 b/.unreleased/pr_7488 deleted file mode 100644 index f8050f7ebb7..00000000000 --- a/.unreleased/pr_7488 +++ /dev/null @@ -1 +0,0 @@ -Fixes: #7488 Emit error for transition table trigger on chunks diff --git a/.unreleased/pr_7514 b/.unreleased/pr_7514 deleted file mode 100644 index e7ab40104d7..00000000000 --- a/.unreleased/pr_7514 +++ /dev/null @@ -1 +0,0 @@ -Fixes: #7514 Fix error: invalid child of chunk append diff --git a/.unreleased/resolve-vars b/.unreleased/resolve-vars deleted file mode 100644 index 51f42a33713..00000000000 --- a/.unreleased/resolve-vars +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: #7410 "aggregated compressed column not found" error on aggregation query. -Thanks: @uasiddiqi for reporting the "aggregated compressed column not found" error. diff --git a/CHANGELOG.md b/CHANGELOG.md index d745eb8a037..8e90a5629e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,42 @@ `psql` with the `-X` flag to prevent any `.psqlrc` commands from accidentally triggering the load of a previous DB version.** + +## 2.18.0 (2024-12-13) + +This release contains performance improvements and bug fixes since +the 2.17.2 release. We recommend that you upgrade at the next +available opportunity. + + +**Features** +* #6901 Add hypertable support for transition tables +* #7104 Hypercore table access method +* #7271 Push down ORDER BY in real time continuous aggregate queries +* #7295: Support ALTER TABLE SET ACCESS METHOD on hypertable. +* #7390 Disable custom hashagg planner code +* #7411 Change parameter name to enable Hypercore TAM +* #7412 Add GUC for hypercore_use_access_method default +* #7413: Add GUC for segmentwise recompression. +* #7443 Add Hypercore function and view aliases +* #7455: Support DROP NOT NULL on compressed hypertables +* #7486 Prevent building against postgres versions with broken ABI + +**Bugfixes** +* #7378 Remove obsolete job referencing policy_job_error_retention +* #7409 Update bgw job table when altering procedure +* #7410 "aggregated compressed column not found" error on aggregation query. +* #7426 Fix datetime parsing error in chunk constraint creation +* #7432 Verify that heap tuple is valid before using +* #7434 Fixes segfault when internally set the replica identity for a given chunk +* #7488 Emit error for transition table trigger on chunks +* #7514 Fix error: invalid child of chunk append + +**Thanks** +* @bharrisau for reporting the segfault when creating chunks +* @pgloader for reporting an issue an internal background job +* @uasiddiqi for reporting the "aggregated compressed column not found" error. + ## 2.17.2 (2024-11-06) This release contains bug fixes since the 2.17.1 release. We recommend that you diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index b3d7f3d39b5..7c875848514 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -45,11 +45,12 @@ set(MOD_FILES updates/2.16.0--2.16.1.sql updates/2.16.1--2.17.0.sql updates/2.17.0--2.17.1.sql - updates/2.17.1--2.17.2.sql) + updates/2.17.1--2.17.2.sql + updates/2.17.2--2.18.0.sql) # The downgrade file to generate a downgrade script for the current version, as # specified in version.config -set(CURRENT_REV_FILE reverse-dev.sql) +set(CURRENT_REV_FILE 2.18.0--2.17.2.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. @@ -90,7 +91,8 @@ set(OLD_REV_FILES 2.16.1--2.16.0.sql 2.17.0--2.16.1.sql 2.17.1--2.17.0.sql - 2.17.2--2.17.1.sql) + 2.17.2--2.17.1.sql + 2.18.0--2.17.2.sql) set(MODULE_PATHNAME "$libdir/timescaledb-${PROJECT_VERSION_MOD}") set(LOADER_PATHNAME "$libdir/timescaledb") diff --git a/sql/updates/2.17.2--2.18.0.sql b/sql/updates/2.17.2--2.18.0.sql new file mode 100644 index 00000000000..d233b0ae5f8 --- /dev/null +++ b/sql/updates/2.17.2--2.18.0.sql @@ -0,0 +1,116 @@ +-- remove obsolete job +DELETE FROM _timescaledb_config.bgw_job WHERE id = 2; + +-- Hypercore updates +CREATE FUNCTION _timescaledb_debug.is_compressed_tid(tid) RETURNS BOOL +AS '@MODULE_PATHNAME@', 'ts_update_placeholder' LANGUAGE C STRICT; + +DROP FUNCTION IF EXISTS @extschema@.compress_chunk(uncompressed_chunk REGCLASS, if_not_compressed BOOLEAN, recompress BOOLEAN); + +CREATE FUNCTION @extschema@.compress_chunk( + uncompressed_chunk REGCLASS, + if_not_compressed BOOLEAN = true, + recompress BOOLEAN = false, + hypercore_use_access_method BOOL = NULL +) RETURNS REGCLASS AS '@MODULE_PATHNAME@', 'ts_update_placeholder' LANGUAGE C VOLATILE; + +DROP FUNCTION IF EXISTS @extschema@.add_compression_policy(hypertable REGCLASS, compress_after "any", if_not_exists BOOL, schedule_interval INTERVAL, initial_start TIMESTAMPTZ, timezone TEXT, compress_created_before INTERVAL); + +CREATE FUNCTION @extschema@.add_compression_policy( + hypertable REGCLASS, + compress_after "any" = NULL, + if_not_exists BOOL = false, + schedule_interval INTERVAL = NULL, + initial_start TIMESTAMPTZ = NULL, + timezone TEXT = NULL, + compress_created_before INTERVAL = NULL, + hypercore_use_access_method BOOL = NULL +) +RETURNS INTEGER +AS '@MODULE_PATHNAME@', 'ts_update_placeholder' +LANGUAGE C VOLATILE; + +DROP FUNCTION IF EXISTS timescaledb_experimental.add_policies(relation REGCLASS, if_not_exists BOOL, refresh_start_offset "any", refresh_end_offset "any", compress_after "any", drop_after "any"); + +CREATE FUNCTION timescaledb_experimental.add_policies( + relation REGCLASS, + if_not_exists BOOL = false, + refresh_start_offset "any" = NULL, + refresh_end_offset "any" = NULL, + compress_after "any" = NULL, + drop_after "any" = NULL, + hypercore_use_access_method BOOL = NULL) +RETURNS BOOL +AS '@MODULE_PATHNAME@', 'ts_update_placeholder' +LANGUAGE C VOLATILE; + +DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression_execute(job_id INTEGER, htid INTEGER, lag ANYELEMENT, maxchunks INTEGER, verbose_log BOOLEAN, recompress_enabled BOOLEAN, use_creation_time BOOLEAN); + +DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression(job_id INTEGER, config JSONB); + +CREATE PROCEDURE @extschema@.convert_to_columnstore( + chunk REGCLASS, + if_not_columnstore BOOLEAN = true, + recompress BOOLEAN = false, + hypercore_use_access_method BOOL = NULL) +AS '@MODULE_PATHNAME@', 'ts_update_placeholder' +LANGUAGE C; + +CREATE PROCEDURE @extschema@.convert_to_rowstore( + chunk REGCLASS, + if_columnstore BOOLEAN = true) +AS '@MODULE_PATHNAME@', 'ts_update_placeholder' +LANGUAGE C; + +CREATE PROCEDURE @extschema@.add_columnstore_policy( + hypertable REGCLASS, + after "any" = NULL, + if_not_exists BOOL = false, + schedule_interval INTERVAL = NULL, + initial_start TIMESTAMPTZ = NULL, + timezone TEXT = NULL, + created_before INTERVAL = NULL, + hypercore_use_access_method BOOL = NULL +) LANGUAGE C AS '@MODULE_PATHNAME@', 'ts_update_placeholder'; + +CREATE PROCEDURE @extschema@.remove_columnstore_policy( + hypertable REGCLASS, + if_exists BOOL = false +) LANGUAGE C AS '@MODULE_PATHNAME@', 'ts_update_placeholder'; + +CREATE FUNCTION @extschema@.chunk_columnstore_stats (hypertable REGCLASS) + RETURNS TABLE ( + chunk_schema name, + chunk_name name, + compression_status text, + before_compression_table_bytes bigint, + before_compression_index_bytes bigint, + before_compression_toast_bytes bigint, + before_compression_total_bytes bigint, + after_compression_table_bytes bigint, + after_compression_index_bytes bigint, + after_compression_toast_bytes bigint, + after_compression_total_bytes bigint, + node_name name) + LANGUAGE SQL + STABLE STRICT + AS 'SELECT * FROM @extschema@.chunk_compression_stats($1)' + SET search_path TO pg_catalog, pg_temp; + +CREATE FUNCTION @extschema@.hypertable_columnstore_stats (hypertable REGCLASS) + RETURNS TABLE ( + total_chunks bigint, + number_compressed_chunks bigint, + before_compression_table_bytes bigint, + before_compression_index_bytes bigint, + before_compression_toast_bytes bigint, + before_compression_total_bytes bigint, + after_compression_table_bytes bigint, + after_compression_index_bytes bigint, + after_compression_toast_bytes bigint, + after_compression_total_bytes bigint, + node_name name) + LANGUAGE SQL + STABLE STRICT + AS 'SELECT * FROM @extschema@.hypertable_compression_stats($1)' + SET search_path TO pg_catalog, pg_temp; diff --git a/sql/updates/2.18.0--2.17.2.sql b/sql/updates/2.18.0--2.17.2.sql new file mode 100644 index 00000000000..6b75bc1c851 --- /dev/null +++ b/sql/updates/2.18.0--2.17.2.sql @@ -0,0 +1,59 @@ +-- Hypercore AM +DROP ACCESS METHOD IF EXISTS hypercore_proxy; +DROP FUNCTION IF EXISTS ts_hypercore_proxy_handler; +DROP ACCESS METHOD IF EXISTS hypercore; +DROP FUNCTION IF EXISTS ts_hypercore_handler; +DROP FUNCTION IF EXISTS _timescaledb_debug.is_compressed_tid; + +DROP FUNCTION IF EXISTS @extschema@.compress_chunk(uncompressed_chunk REGCLASS, if_not_compressed BOOLEAN, recompress BOOLEAN, hypercore_use_access_method BOOL); + +CREATE FUNCTION @extschema@.compress_chunk( + uncompressed_chunk REGCLASS, + if_not_compressed BOOLEAN = true, + recompress BOOLEAN = false +) RETURNS REGCLASS AS '@MODULE_PATHNAME@', 'ts_compress_chunk' LANGUAGE C STRICT VOLATILE; + +DROP FUNCTION IF EXISTS @extschema@.add_compression_policy(hypertable REGCLASS, compress_after "any", if_not_exists BOOL, schedule_interval INTERVAL, initial_start TIMESTAMPTZ, timezone TEXT, compress_created_before INTERVAL, hypercore_use_access_method BOOL); + +CREATE FUNCTION @extschema@.add_compression_policy( + hypertable REGCLASS, + compress_after "any" = NULL, + if_not_exists BOOL = false, + schedule_interval INTERVAL = NULL, + initial_start TIMESTAMPTZ = NULL, + timezone TEXT = NULL, + compress_created_before INTERVAL = NULL +) +RETURNS INTEGER +AS '@MODULE_PATHNAME@', 'ts_policy_compression_add' +LANGUAGE C VOLATILE; + +DROP FUNCTION IF EXISTS timescaledb_experimental.add_policies(relation REGCLASS, if_not_exists BOOL, refresh_start_offset "any", refresh_end_offset "any", compress_after "any", drop_after "any", hypercore_use_access_method BOOL); + +CREATE FUNCTION timescaledb_experimental.add_policies( + relation REGCLASS, + if_not_exists BOOL = false, + refresh_start_offset "any" = NULL, + refresh_end_offset "any" = NULL, + compress_after "any" = NULL, + drop_after "any" = NULL) +RETURNS BOOL +AS '@MODULE_PATHNAME@', 'ts_policies_add' +LANGUAGE C VOLATILE; + +DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression_execute(job_id INTEGER, htid INTEGER, lag ANYELEMENT, maxchunks INTEGER, verbose_log BOOLEAN, recompress_enabled BOOLEAN, use_creation_time BOOLEAN, useam BOOLEAN); + +DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression(job_id INTEGER, config JSONB); +DROP PROCEDURE IF EXISTS @extschema@.convert_to_columnstore(REGCLASS, BOOLEAN, BOOLEAN, BOOLEAN); +DROP PROCEDURE IF EXISTS @extschema@.convert_to_rowstore(REGCLASS, BOOLEAN); +DROP PROCEDURE IF EXISTS @extschema@.add_columnstore_policy(REGCLASS, "any", BOOL, INTERVAL, TIMESTAMPTZ, TEXT, INTERVAL, BOOL); +DROP PROCEDURE IF EXISTS @extschema@.remove_columnstore_policy(REGCLASS, BOOL); +DROP FUNCTION IF EXISTS @extschema@.hypertable_columnstore_stats(REGCLASS); +DROP FUNCTION IF EXISTS @extschema@.chunk_columnstore_stats(REGCLASS); + +ALTER EXTENSION timescaledb DROP VIEW timescaledb_information.hypertable_columnstore_settings; +ALTER EXTENSION timescaledb DROP VIEW timescaledb_information.chunk_columnstore_settings; + +DROP VIEW timescaledb_information.hypertable_columnstore_settings; +DROP VIEW timescaledb_information.chunk_columnstore_settings; + diff --git a/sql/updates/latest-dev.sql b/sql/updates/latest-dev.sql index d233b0ae5f8..e69de29bb2d 100644 --- a/sql/updates/latest-dev.sql +++ b/sql/updates/latest-dev.sql @@ -1,116 +0,0 @@ --- remove obsolete job -DELETE FROM _timescaledb_config.bgw_job WHERE id = 2; - --- Hypercore updates -CREATE FUNCTION _timescaledb_debug.is_compressed_tid(tid) RETURNS BOOL -AS '@MODULE_PATHNAME@', 'ts_update_placeholder' LANGUAGE C STRICT; - -DROP FUNCTION IF EXISTS @extschema@.compress_chunk(uncompressed_chunk REGCLASS, if_not_compressed BOOLEAN, recompress BOOLEAN); - -CREATE FUNCTION @extschema@.compress_chunk( - uncompressed_chunk REGCLASS, - if_not_compressed BOOLEAN = true, - recompress BOOLEAN = false, - hypercore_use_access_method BOOL = NULL -) RETURNS REGCLASS AS '@MODULE_PATHNAME@', 'ts_update_placeholder' LANGUAGE C VOLATILE; - -DROP FUNCTION IF EXISTS @extschema@.add_compression_policy(hypertable REGCLASS, compress_after "any", if_not_exists BOOL, schedule_interval INTERVAL, initial_start TIMESTAMPTZ, timezone TEXT, compress_created_before INTERVAL); - -CREATE FUNCTION @extschema@.add_compression_policy( - hypertable REGCLASS, - compress_after "any" = NULL, - if_not_exists BOOL = false, - schedule_interval INTERVAL = NULL, - initial_start TIMESTAMPTZ = NULL, - timezone TEXT = NULL, - compress_created_before INTERVAL = NULL, - hypercore_use_access_method BOOL = NULL -) -RETURNS INTEGER -AS '@MODULE_PATHNAME@', 'ts_update_placeholder' -LANGUAGE C VOLATILE; - -DROP FUNCTION IF EXISTS timescaledb_experimental.add_policies(relation REGCLASS, if_not_exists BOOL, refresh_start_offset "any", refresh_end_offset "any", compress_after "any", drop_after "any"); - -CREATE FUNCTION timescaledb_experimental.add_policies( - relation REGCLASS, - if_not_exists BOOL = false, - refresh_start_offset "any" = NULL, - refresh_end_offset "any" = NULL, - compress_after "any" = NULL, - drop_after "any" = NULL, - hypercore_use_access_method BOOL = NULL) -RETURNS BOOL -AS '@MODULE_PATHNAME@', 'ts_update_placeholder' -LANGUAGE C VOLATILE; - -DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression_execute(job_id INTEGER, htid INTEGER, lag ANYELEMENT, maxchunks INTEGER, verbose_log BOOLEAN, recompress_enabled BOOLEAN, use_creation_time BOOLEAN); - -DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression(job_id INTEGER, config JSONB); - -CREATE PROCEDURE @extschema@.convert_to_columnstore( - chunk REGCLASS, - if_not_columnstore BOOLEAN = true, - recompress BOOLEAN = false, - hypercore_use_access_method BOOL = NULL) -AS '@MODULE_PATHNAME@', 'ts_update_placeholder' -LANGUAGE C; - -CREATE PROCEDURE @extschema@.convert_to_rowstore( - chunk REGCLASS, - if_columnstore BOOLEAN = true) -AS '@MODULE_PATHNAME@', 'ts_update_placeholder' -LANGUAGE C; - -CREATE PROCEDURE @extschema@.add_columnstore_policy( - hypertable REGCLASS, - after "any" = NULL, - if_not_exists BOOL = false, - schedule_interval INTERVAL = NULL, - initial_start TIMESTAMPTZ = NULL, - timezone TEXT = NULL, - created_before INTERVAL = NULL, - hypercore_use_access_method BOOL = NULL -) LANGUAGE C AS '@MODULE_PATHNAME@', 'ts_update_placeholder'; - -CREATE PROCEDURE @extschema@.remove_columnstore_policy( - hypertable REGCLASS, - if_exists BOOL = false -) LANGUAGE C AS '@MODULE_PATHNAME@', 'ts_update_placeholder'; - -CREATE FUNCTION @extschema@.chunk_columnstore_stats (hypertable REGCLASS) - RETURNS TABLE ( - chunk_schema name, - chunk_name name, - compression_status text, - before_compression_table_bytes bigint, - before_compression_index_bytes bigint, - before_compression_toast_bytes bigint, - before_compression_total_bytes bigint, - after_compression_table_bytes bigint, - after_compression_index_bytes bigint, - after_compression_toast_bytes bigint, - after_compression_total_bytes bigint, - node_name name) - LANGUAGE SQL - STABLE STRICT - AS 'SELECT * FROM @extschema@.chunk_compression_stats($1)' - SET search_path TO pg_catalog, pg_temp; - -CREATE FUNCTION @extschema@.hypertable_columnstore_stats (hypertable REGCLASS) - RETURNS TABLE ( - total_chunks bigint, - number_compressed_chunks bigint, - before_compression_table_bytes bigint, - before_compression_index_bytes bigint, - before_compression_toast_bytes bigint, - before_compression_total_bytes bigint, - after_compression_table_bytes bigint, - after_compression_index_bytes bigint, - after_compression_toast_bytes bigint, - after_compression_total_bytes bigint, - node_name name) - LANGUAGE SQL - STABLE STRICT - AS 'SELECT * FROM @extschema@.hypertable_compression_stats($1)' - SET search_path TO pg_catalog, pg_temp; diff --git a/sql/updates/reverse-dev.sql b/sql/updates/reverse-dev.sql index 6b75bc1c851..e69de29bb2d 100644 --- a/sql/updates/reverse-dev.sql +++ b/sql/updates/reverse-dev.sql @@ -1,59 +0,0 @@ --- Hypercore AM -DROP ACCESS METHOD IF EXISTS hypercore_proxy; -DROP FUNCTION IF EXISTS ts_hypercore_proxy_handler; -DROP ACCESS METHOD IF EXISTS hypercore; -DROP FUNCTION IF EXISTS ts_hypercore_handler; -DROP FUNCTION IF EXISTS _timescaledb_debug.is_compressed_tid; - -DROP FUNCTION IF EXISTS @extschema@.compress_chunk(uncompressed_chunk REGCLASS, if_not_compressed BOOLEAN, recompress BOOLEAN, hypercore_use_access_method BOOL); - -CREATE FUNCTION @extschema@.compress_chunk( - uncompressed_chunk REGCLASS, - if_not_compressed BOOLEAN = true, - recompress BOOLEAN = false -) RETURNS REGCLASS AS '@MODULE_PATHNAME@', 'ts_compress_chunk' LANGUAGE C STRICT VOLATILE; - -DROP FUNCTION IF EXISTS @extschema@.add_compression_policy(hypertable REGCLASS, compress_after "any", if_not_exists BOOL, schedule_interval INTERVAL, initial_start TIMESTAMPTZ, timezone TEXT, compress_created_before INTERVAL, hypercore_use_access_method BOOL); - -CREATE FUNCTION @extschema@.add_compression_policy( - hypertable REGCLASS, - compress_after "any" = NULL, - if_not_exists BOOL = false, - schedule_interval INTERVAL = NULL, - initial_start TIMESTAMPTZ = NULL, - timezone TEXT = NULL, - compress_created_before INTERVAL = NULL -) -RETURNS INTEGER -AS '@MODULE_PATHNAME@', 'ts_policy_compression_add' -LANGUAGE C VOLATILE; - -DROP FUNCTION IF EXISTS timescaledb_experimental.add_policies(relation REGCLASS, if_not_exists BOOL, refresh_start_offset "any", refresh_end_offset "any", compress_after "any", drop_after "any", hypercore_use_access_method BOOL); - -CREATE FUNCTION timescaledb_experimental.add_policies( - relation REGCLASS, - if_not_exists BOOL = false, - refresh_start_offset "any" = NULL, - refresh_end_offset "any" = NULL, - compress_after "any" = NULL, - drop_after "any" = NULL) -RETURNS BOOL -AS '@MODULE_PATHNAME@', 'ts_policies_add' -LANGUAGE C VOLATILE; - -DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression_execute(job_id INTEGER, htid INTEGER, lag ANYELEMENT, maxchunks INTEGER, verbose_log BOOLEAN, recompress_enabled BOOLEAN, use_creation_time BOOLEAN, useam BOOLEAN); - -DROP PROCEDURE IF EXISTS _timescaledb_functions.policy_compression(job_id INTEGER, config JSONB); -DROP PROCEDURE IF EXISTS @extschema@.convert_to_columnstore(REGCLASS, BOOLEAN, BOOLEAN, BOOLEAN); -DROP PROCEDURE IF EXISTS @extschema@.convert_to_rowstore(REGCLASS, BOOLEAN); -DROP PROCEDURE IF EXISTS @extschema@.add_columnstore_policy(REGCLASS, "any", BOOL, INTERVAL, TIMESTAMPTZ, TEXT, INTERVAL, BOOL); -DROP PROCEDURE IF EXISTS @extschema@.remove_columnstore_policy(REGCLASS, BOOL); -DROP FUNCTION IF EXISTS @extschema@.hypertable_columnstore_stats(REGCLASS); -DROP FUNCTION IF EXISTS @extschema@.chunk_columnstore_stats(REGCLASS); - -ALTER EXTENSION timescaledb DROP VIEW timescaledb_information.hypertable_columnstore_settings; -ALTER EXTENSION timescaledb DROP VIEW timescaledb_information.chunk_columnstore_settings; - -DROP VIEW timescaledb_information.hypertable_columnstore_settings; -DROP VIEW timescaledb_information.chunk_columnstore_settings; - diff --git a/version.config b/version.config index 69be6f54f70..a458437f1eb 100644 --- a/version.config +++ b/version.config @@ -1,3 +1,3 @@ -version = 2.18.0-dev +version = 2.18.0 update_from_version = 2.17.2 downgrade_to_version = 2.17.2