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_stats view #2461

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
2 changes: 1 addition & 1 deletion sql/views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CREATE OR REPLACE VIEW timescaledb_information.license AS
_timescaledb_internal.license_expiration_time() <= now() AS expired,
_timescaledb_internal.license_expiration_time() AS expiration_time;

CREATE OR REPLACE VIEW timescaledb_information.policy_stats as
CREATE OR REPLACE VIEW timescaledb_information.job_stats as
SELECT format('%1$I.%2$I', ht.schema_name, ht.table_name)::regclass as hypertable, j.id AS job_id,
js.last_start as last_run_started_at,
js.last_successful_finish as last_successful_finish,
Expand Down
2 changes: 1 addition & 1 deletion test/expected/pg_dump.out
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ WHERE refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass AND
timescaledb_information.data_node
timescaledb_information.continuous_aggregates
timescaledb_information.jobs
timescaledb_information.policy_stats
timescaledb_information.job_stats
timescaledb_information.license
timescaledb_information.hypertables
_timescaledb_internal.compressed_chunk_stats
Expand Down
6 changes: 3 additions & 3 deletions tsl/test/expected/bgw_reorder_drop_chunks.out
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ SELECT * FROM _timescaledb_config.bgw_job;
----+------------------+-------------------+-------------+-------------+--------------+-------------+-----------+-------+-----------+---------------+--------
(0 rows)

SELECT * FROM timescaledb_information.policy_stats;
SELECT * FROM timescaledb_information.job_stats;
hypertable | job_id | last_run_started_at | last_successful_finish | last_run_status | job_status | last_run_duration | next_scheduled_run | total_runs | total_successes | total_failures
------------+--------+---------------------+------------------------+-----------------+------------+-------------------+--------------------+------------+-----------------+----------------
(0 rows)
Expand Down Expand Up @@ -291,7 +291,7 @@ SELECT indexrelid::regclass, indisclustered
(3 rows)

--check that views work correctly
SELECT * FROM timescaledb_information.policy_stats;
SELECT * FROM timescaledb_information.job_stats;
hypertable | job_id | last_run_started_at | last_successful_finish | last_run_status | job_status | last_run_duration | next_scheduled_run | total_runs | total_successes | total_failures
--------------------+--------+---------------------------------+---------------------------------+-----------------+------------+-------------------+---------------------------------+------------+-----------------+----------------
test_reorder_table | 1000 | Fri Dec 31 16:00:00.05 1999 PST | Fri Dec 31 16:00:00.05 1999 PST | Success | Scheduled | | Tue Jan 04 16:00:00.05 2000 PST | 3 | 3 | 0
Expand Down Expand Up @@ -568,7 +568,7 @@ SELECT show_chunks('test_drop_chunks_table');
(3 rows)

--test that views work
SELECT * FROM timescaledb_information.policy_stats;
SELECT * FROM timescaledb_information.job_stats;
hypertable | job_id | last_run_started_at | last_successful_finish | last_run_status | job_status | last_run_duration | next_scheduled_run | total_runs | total_successes | total_failures
------------------------+--------+------------------------------+------------------------------+-----------------+------------+-------------------+------------------------------+------------+-----------------+----------------
test_drop_chunks_table | 1001 | Fri Dec 31 16:00:01 1999 PST | Fri Dec 31 16:00:01 1999 PST | Success | Scheduled | | Fri Dec 31 16:00:02 1999 PST | 2 | 2 | 0
Expand Down
4 changes: 2 additions & 2 deletions tsl/test/expected/continuous_aggs_bgw.out
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ SELECT * FROM _timescaledb_config.bgw_job;
----+------------------+-------------------+-------------+-------------+--------------+-------------+-----------+-------+-----------+---------------+--------
(0 rows)

SELECT * FROM timescaledb_information.policy_stats;
SELECT * FROM timescaledb_information.job_stats;
hypertable | job_id | last_run_started_at | last_successful_finish | last_run_status | job_status | last_run_duration | next_scheduled_run | total_runs | total_successes | total_failures
------------+--------+---------------------+------------------------+-----------------+------------+-------------------+--------------------+------------+-----------------+----------------
(0 rows)
Expand Down Expand Up @@ -466,7 +466,7 @@ view_definition | SELECT time_bucket(2, test_continuous_agg_table."time") AS ti
| GROUP BY (time_bucket(2, test_continuous_agg_table."time"));

select job_status, last_run_duration
from timescaledb_information.policy_stats ps, timescaledb_information.continuous_aggregates cagg
from timescaledb_information.job_stats ps, timescaledb_information.continuous_aggregates cagg
where cagg.view_name::text like '%test_continuous_agg_view'
and cagg.materialization_hypertable = ps.hypertable;
-[ RECORD 1 ]-----+----------
Expand Down
6 changes: 3 additions & 3 deletions tsl/test/sql/bgw_reorder_drop_chunks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ INSERT INTO public.bgw_dsm_handle_store VALUES (0);
SELECT ts_bgw_params_create();

SELECT * FROM _timescaledb_config.bgw_job;
SELECT * FROM timescaledb_information.policy_stats;
SELECT * FROM timescaledb_information.job_stats;

\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER

Expand Down Expand Up @@ -169,7 +169,7 @@ SELECT indexrelid::regclass, indisclustered
WHERE indisclustered = true ORDER BY 1;

--check that views work correctly
SELECT * FROM timescaledb_information.policy_stats;
SELECT * FROM timescaledb_information.job_stats;

-- test deleting the policy
SELECT remove_reorder_policy('test_reorder_table');
Expand Down Expand Up @@ -284,4 +284,4 @@ SELECT job_id, time_bucket('1m',next_start) AS next_start, time_bucket('1m',last
SELECT show_chunks('test_drop_chunks_table');

--test that views work
SELECT * FROM timescaledb_information.policy_stats;
SELECT * FROM timescaledb_information.job_stats;
4 changes: 2 additions & 2 deletions tsl/test/sql/continuous_aggs_bgw.sql
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ INSERT INTO public.bgw_dsm_handle_store VALUES (0);
SELECT ts_bgw_params_create();

SELECT * FROM _timescaledb_config.bgw_job;
SELECT * FROM timescaledb_information.policy_stats;
SELECT * FROM timescaledb_information.job_stats;
SELECT * FROM _timescaledb_catalog.continuous_agg;

\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
Expand Down Expand Up @@ -272,7 +272,7 @@ select view_name, view_definition from timescaledb_information.continuous_aggreg
where view_name::text like '%test_continuous_agg_view';

select job_status, last_run_duration
from timescaledb_information.policy_stats ps, timescaledb_information.continuous_aggregates cagg
from timescaledb_information.job_stats ps, timescaledb_information.continuous_aggregates cagg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: still using ps as a name

where cagg.view_name::text like '%test_continuous_agg_view'
and cagg.materialization_hypertable = ps.hypertable;

Expand Down