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

Rename policy parameters #2458

Merged
merged 1 commit into from Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions sql/policy_api.sql
Expand Up @@ -12,7 +12,7 @@
-- might be kept, but data within the window will never be deleted.
CREATE OR REPLACE FUNCTION add_retention_policy(
hypertable REGCLASS,
retention_window "any",
drop_after "any",
if_not_exists BOOL = false
)
RETURNS INTEGER AS '@MODULE_PATHNAME@', 'ts_policy_retention_add'
Expand All @@ -32,7 +32,7 @@ AS '@MODULE_PATHNAME@', 'ts_policy_reorder_remove'
LANGUAGE C VOLATILE STRICT;

/* compression policy */
CREATE OR REPLACE FUNCTION add_compression_policy(hypertable REGCLASS, older_than "any", if_not_exists BOOL = false)
CREATE OR REPLACE FUNCTION add_compression_policy(hypertable REGCLASS, compress_after "any", if_not_exists BOOL = false)
RETURNS INTEGER
AS '@MODULE_PATHNAME@', 'ts_policy_compression_add'
LANGUAGE C VOLATILE STRICT;
Expand Down
4 changes: 2 additions & 2 deletions tsl/test/expected/continuous_aggs_bgw_drop_chunks.out
Expand Up @@ -69,7 +69,7 @@ CALL refresh_continuous_aggregate('drop_chunks_view1', NULL, NULL);
--TEST1 specify drop chunks policy on mat. hypertable by
-- directly does not work
\set ON_ERROR_STOP 0
SELECT add_retention_policy( '_timescaledb_internal._materialized_hypertable_2', retention_window=> -50) as drop_chunks_job_id1 \gset
SELECT add_retention_policy( '_timescaledb_internal._materialized_hypertable_2', drop_after => -50) as drop_chunks_job_id1 \gset
ERROR: cannot add retention policy to materialized hypertable "_materialized_hypertable_2"
\set ON_ERROR_STOP 1
--TEST2 specify drop chunks policy on cont. aggregate
Expand All @@ -95,7 +95,7 @@ WHERE hypertable_name = '_materialized_hypertable_2' ORDER BY range_start_intege
_hyper_2_43_chunk | 30 | 40
(4 rows)

SELECT add_retention_policy( 'drop_chunks_view1', retention_window=> 10) as drop_chunks_job_id1 \gset
SELECT add_retention_policy( 'drop_chunks_view1', drop_after => 10) as drop_chunks_job_id1 \gset
SELECT alter_job(:drop_chunks_job_id1, schedule_interval => INTERVAL '1 second');
alter_job
----------------------------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions tsl/test/sql/continuous_aggs_bgw_drop_chunks.sql
Expand Up @@ -66,7 +66,7 @@ CALL refresh_continuous_aggregate('drop_chunks_view1', NULL, NULL);
-- directly does not work

\set ON_ERROR_STOP 0
SELECT add_retention_policy( '_timescaledb_internal._materialized_hypertable_2', retention_window=> -50) as drop_chunks_job_id1 \gset
SELECT add_retention_policy( '_timescaledb_internal._materialized_hypertable_2', drop_after => -50) as drop_chunks_job_id1 \gset
\set ON_ERROR_STOP 1

--TEST2 specify drop chunks policy on cont. aggregate
Expand All @@ -80,7 +80,7 @@ SELECT chunk_name, range_start_integer, range_end_integer
FROM timescaledb_information.chunks
WHERE hypertable_name = '_materialized_hypertable_2' ORDER BY range_start_integer;

SELECT add_retention_policy( 'drop_chunks_view1', retention_window=> 10) as drop_chunks_job_id1 \gset
SELECT add_retention_policy( 'drop_chunks_view1', drop_after => 10) as drop_chunks_job_id1 \gset
SELECT alter_job(:drop_chunks_job_id1, schedule_interval => INTERVAL '1 second');
SELECT ts_bgw_db_scheduler_test_run_and_wait_for_scheduler_finish(2000000);
SELECT count(c) from show_chunks('drop_chunks_view1') as c ;
Expand Down