forked from citusdata/pg_cron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request citusdata#47 from Voipfuture-GmbH/master
Add a 'active' column on con.job table to simply enable and disable jobs
- Loading branch information
Showing
11 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
CREATE EXTENSION pg_cron VERSION '1.0'; | ||
SELECT extversion FROM pg_extension WHERE extname='pg_cron'; | ||
extversion | ||
------------ | ||
1.0 | ||
(1 row) | ||
|
||
ALTER EXTENSION pg_cron UPDATE TO '1.1'; | ||
SELECT extversion FROM pg_extension WHERE extname='pg_cron'; | ||
extversion | ||
------------ | ||
1.1 | ||
(1 row) | ||
|
||
-- Vacuum every day at 10:00am (GMT) | ||
SELECT cron.schedule('0 10 * * *', 'VACUUM'); | ||
schedule | ||
---------- | ||
1 | ||
(1 row) | ||
|
||
-- Stop scheduling a job | ||
SELECT cron.unschedule(1); | ||
unschedule | ||
------------ | ||
t | ||
(1 row) | ||
|
||
DROP EXTENSION pg_cron; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ typedef struct CronJob | |
int nodePort; | ||
char *database; | ||
char *userName; | ||
bool active; | ||
} CronJob; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* pg_cron--1.0--1.1.sql */ | ||
|
||
ALTER TABLE cron.job ADD COLUMN active boolean not null default 'true'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
comment = 'Job scheduler for PostgreSQL' | ||
default_version = '1.0' | ||
default_version = '1.1' | ||
module_pathname = '$libdir/pg_cron' | ||
relocatable = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE EXTENSION pg_cron VERSION '1.0'; | ||
SELECT extversion FROM pg_extension WHERE extname='pg_cron'; | ||
ALTER EXTENSION pg_cron UPDATE TO '1.1'; | ||
SELECT extversion FROM pg_extension WHERE extname='pg_cron'; | ||
|
||
-- Vacuum every day at 10:00am (GMT) | ||
SELECT cron.schedule('0 10 * * *', 'VACUUM'); | ||
|
||
-- Stop scheduling a job | ||
SELECT cron.unschedule(1); | ||
|
||
DROP EXTENSION pg_cron; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters