Skip to content

Commit

Permalink
Update bgw view
Browse files Browse the repository at this point in the history
  • Loading branch information
mkindahl committed Oct 13, 2023
1 parent 4fa33b3 commit f8286d1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
28 changes: 14 additions & 14 deletions tsl/test/expected/bgw_scheduler_control.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
-- LICENSE-TIMESCALE for a copy of the license.
\c :TEST_DBNAME :ROLE_SUPERUSER
CREATE VIEW tsdb_bgw AS
SELECT datname, state, application_name
FROM pg_stat_activity
WHERE application_name LIKE 'TimescaleDB%';
SELECT application_name FROM pg_stat_activity
WHERE application_name LIKE 'TimescaleDB%'
ORDER BY application_name;
SHOW timescaledb.bgw_scheduler_restart_time;
timescaledb.bgw_scheduler_restart_time
----------------------------------------
Expand All @@ -19,10 +19,10 @@ SELECT _timescaledb_functions.start_background_workers() FROM pg_sleep(5);
(1 row)

SELECT * FROM tsdb_bgw;
datname | state | application_name
--------------------------+-------+-----------------------------------------
| | TimescaleDB Background Worker Launcher
db_bgw_scheduler_control | | TimescaleDB Background Worker Scheduler
application_name
-----------------------------------------
TimescaleDB Background Worker Launcher
TimescaleDB Background Worker Scheduler
(2 rows)

ALTER SYSTEM SET timescaledb.shutdown_bgw_scheduler TO 'on';
Expand All @@ -40,9 +40,9 @@ SELECT pg_sleep(5); -- Wait for scheduler stop.
(1 row)

SELECT * FROM tsdb_bgw;
datname | state | application_name
---------+-------+----------------------------------------
| | TimescaleDB Background Worker Launcher
application_name
----------------------------------------
TimescaleDB Background Worker Launcher
(1 row)

ALTER SYSTEM RESET timescaledb.shutdown_bgw_scheduler;
Expand All @@ -60,9 +60,9 @@ SELECT pg_sleep(30); -- Wait for scheduler to restart.
(1 row)

SELECT * FROM tsdb_bgw;
datname | state | application_name
--------------------------+-------+-----------------------------------------
| | TimescaleDB Background Worker Launcher
db_bgw_scheduler_control | idle | TimescaleDB Background Worker Scheduler
application_name
-----------------------------------------
TimescaleDB Background Worker Launcher
TimescaleDB Background Worker Scheduler
(2 rows)

6 changes: 3 additions & 3 deletions tsl/test/sql/bgw_scheduler_control.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
\c :TEST_DBNAME :ROLE_SUPERUSER

CREATE VIEW tsdb_bgw AS
SELECT datname, state, application_name
FROM pg_stat_activity
WHERE application_name LIKE 'TimescaleDB%';
SELECT application_name FROM pg_stat_activity
WHERE application_name LIKE 'TimescaleDB%'
ORDER BY application_name;

SHOW timescaledb.bgw_scheduler_restart_time;

Expand Down

0 comments on commit f8286d1

Please sign in to comment.