1
1
[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-green.svg )] ( https://opensource.org/licenses/MIT )
2
- ![ ] ( https://github.com/cybertec-postgresql/pg_timetable/workflows/Go%20Build%20&%20Test/badge.svg )
2
+ ![ Build & Test ] ( https://github.com/cybertec-postgresql/pg_timetable/workflows/Go%20Build%20&%20Test/badge.svg )
3
3
[ ![ Coverage Status] ( https://coveralls.io/repos/github/cybertec-postgresql/pg_timetable/badge.svg?branch=master&service=github )] ( https://coveralls.io/github/cybertec-postgresql/pg_timetable?branch=master )
4
4
[ ![ Documentation Status] ( https://readthedocs.org/projects/pg-timetable/badge/?version=master )] ( https://pg-timetable.readthedocs.io/en/master/?badge=master )
5
5
[ ![ Release] ( https://img.shields.io/github/v/release/cybertec-postgresql/pg_timetable?include_prereleases )] ( https://github.com/cybertec-postgresql/pg_timetable/releases )
8
8
[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/cybertec-postgresql/pg_timetable )] ( https://goreportcard.com/report/github.com/cybertec-postgresql/pg_timetable )
9
9
[ ![ Mentioned in Awesome Go] ( https://awesome.re/mentioned-badge.svg )] ( https://github.com/avelino/awesome-go )
10
10
11
-
12
-
13
- pg_timetable: Advanced scheduling for PostgreSQL
14
- ================================================
11
+ # pg_timetable: Advanced scheduling for PostgreSQL
15
12
16
13
** pg_timetable** is an advanced standalone job scheduler for PostgreSQL, offering many advantages over traditional schedulers such as ** cron** and others.
17
14
It is completely database driven and provides a couple of advanced concepts. It allows you to schedule PostgreSQL commands, system programs and built-in operations:
@@ -43,12 +40,14 @@ SELECT timetable.add_job('reindex-job', '0 0 * * 7', 'reindexdb',
43
40
SELECT timetable .add_job (' reindex-job' , ' 0 0 * * 7' , ' bash' ,
44
41
' ["-c", "PGPASSWORD=5m3R7K4754p4m reindexdb -U postgres -h 192.168.0.221 -v"]' ::jsonb,
45
42
' PROGRAM' );
46
- ```
43
+ ```
44
+
47
45
## Documentation
48
46
49
- https://pg-timetable.readthedocs.io/
47
+ < https://pg-timetable.readthedocs.io/ >
50
48
51
49
## Main features
50
+
52
51
- Tasks can be arranged in chains
53
52
- Each task executes SQL, built-in or executable command
54
53
- Parameters can be passed to tasks
@@ -65,53 +64,62 @@ https://pg-timetable.readthedocs.io/
65
64
Complete installation guide can be found in the [ documentation] ( https://pg-timetable.readthedocs.io/en/master/installation.html ) .
66
65
67
66
Possible choices are:
67
+
68
68
- official [ release packages] ( https://github.com/cybertec-postgresql/pg_timetable/releases ) ;
69
69
- [ Docker images] ( https://hub.docker.com/r/cybertecpostgresql/pg_timetable ) ;
70
70
- [ build from sources] ( https://pg-timetable.readthedocs.io/en/master/installation.html#build-from-sources ) .
71
71
72
72
## [ Quick Start] ( https://pg-timetable.readthedocs.io/en/master/README.html#quick-start )
73
+
73
74
Complete usage guide can be found in the [ documentation] ( https://pg-timetable.readthedocs.io/en/master/basic_jobs.html ) .
74
75
75
76
1 . Download ** pg_timetable** executable
76
77
77
- 2 . Make sure your ** PostgreSQL** server is up and running and has a role with ` CREATE ` privilege for a target database, e.g.
78
- ``` sql
79
- my_database=> CREATE ROLE scheduler PASSWORD ' somestrong' ;
80
- my_database=> GRANT CREATE ON DATABASE my_database TO scheduler;
81
- ```
82
- 3 . Create a new job, e.g. run ` VACUUM ` each night at 00:30
83
- ``` sql
84
- my_database=> SELECT timetable .add_job (' frequent-vacuum' , ' 30 0 * * *' , ' VACUUM' );
85
- add_job
86
- -- -------
87
- 3
88
- (1 row)
89
- ```
90
- 4 . Run the pg_timetable
91
- ``` terminal
92
- # pg_timetable postgresql://scheduler:somestrong@localhost/my_database --clientname=vacuumer
93
- ```
94
- 5 . PROFIT!
78
+ 1 . Make sure your ** PostgreSQL** server is up and running and has a role with ` CREATE ` privilege for a target database, e.g.
79
+
80
+ ``` sql
81
+ my_database=> CREATE ROLE scheduler PASSWORD ' somestrong' ;
82
+ my_database=> GRANT CREATE ON DATABASE my_database TO scheduler;
83
+ ```
84
+
85
+ 1 . Create a new job, e .g . run ` VACUUM` each night at 00 :30
86
+
87
+ ` ` ` sql
88
+ my_database=> SELECT timetable.add_job('frequent-vacuum', '30 0 * * *', 'VACUUM');
89
+ add_job
90
+ ---------
91
+ 3
92
+ (1 row)
93
+ ` ` `
94
+
95
+ 1 . Run the pg_timetable
96
+
97
+ ` ` ` terminal
98
+ # pg_timetable postgresql://scheduler:somestrong@localhost/my_database --clientname=vacuumer
99
+ ` ` `
100
+
101
+ 1 . PROFIT!
102
+
103
+ # # Supported Environments
95
104
96
- ## Supported Environments
97
105
| Cloud Service | Supported | PostgreSQL Version | Supported | OS | Supported |
98
106
| -- -------------- |:---------:| ------------------- |:---------:| -- |:---------:|
99
107
| [Alibaba Cloud] | ✅ | [18 (devel)] | ✅ | Linux | ✅ |
100
108
| [Amazon RDS] | ✅ | [17 (current)] | ✅ | Darwin | ✅ |
101
- | [ Amazon Aurora] | ✅ | [ 16] | ✅ | Windows | ✅ |
109
+ | [Amazon Aurora] | ✅ | [16 ] | ✅ | Windows | ✅ |
102
110
| [Azure] | ✅ | [15 ] | ✅ | FreeBSD\* | ✅ |
103
111
| [Citus Cloud] | ✅ | [14 ] | ✅ | NetBSD\* | ✅ |
104
- | [ Crunchy Bridge] | ✅ | [ 13] | ✅ | OpenBSD\* | ✅ |
112
+ | [Crunchy Bridge] | ✅ | [13 ] | ✅ | OpenBSD\* | ✅ |
105
113
| [DigitalOcean] | ✅ | [12 ] | ✅ | Solaris\* | ✅ |
106
- | [ Google Cloud] | ✅ | [ 11] | ✅
107
- | [ Heroku] | ✅ | [ 10]
108
- | [ Supabase] | ✅ |
109
- | [ Tembo] | ✅ |
114
+ | [Google Cloud] | ✅ | [11 ] | ✅ | | |
115
+ | [Heroku] | ✅ | [10 ] | | | |
116
+ | [Supabase] | ✅ | | | | |
117
+ | [Tembo] | ✅ | | | | |
110
118
111
119
\* - there are no official release binaries made for these OSes. One would need to [build them from sources](https:// pg- timetable .readthedocs .io/ en/ master/ installation .html # build-from-sources).
112
120
113
121
\** - previous PostgreSQL versions may and should work smoothly. Only [officially supported PostgreSQL versions](https:// www .postgresql .org/ support/ versioning/ ) are listed in this table.
114
-
122
+
115
123
[Alibaba Cloud]: https:// www .alibabacloud .com/ help/ doc- detail/ 96715 .htm
116
124
[Amazon RDS]: https:// aws .amazon .com/ rds/ postgresql/
117
125
[Amazon Aurora]: https:// aws .amazon .com/ rds/ aurora/
@@ -132,23 +140,6 @@ Complete usage guide can be found in the [documentation](https://pg-timetable.re
132
140
[12 ]: https:// www .postgresql .org/ docs/ 12 / index .html
133
141
[11 ]: https:// www .postgresql .org/ docs/ 11 / index .html
134
142
[10 ]: https:// www .postgresql .org/ docs/ 10 / index .html
135
-
136
- [ Alibaba Cloud ] : https://www.alibabacloud.com/help/doc-detail/96715.htm
137
- [ Amazon RDS ] : https://aws.amazon.com/rds/postgresql/
138
- [ Amazon Aurora ] : https://aws.amazon.com/rds/aurora/
139
- [ Azure ] : https://azure.microsoft.com/en-us/services/postgresql/
140
- [ Citus Cloud ] : https://www.citusdata.com/product/cloud
141
- [ Crunchy Bridge ] : https://www.crunchydata.com/products/crunchy-bridge/
142
- [ DigitalOcean ] : https://www.digitalocean.com/products/managed-databases/
143
- [ Google Cloud ] : https://cloud.google.com/sql/docs/postgres/
144
- [ Heroku ] : https://elements.heroku.com/addons/heroku-postgresql
145
- [ Supabase ] : https://supabase.io/docs/guides/database
146
- [ 14 (devel) ] : https://www.postgresql.org/docs/devel/index.html
147
- [ 13 (current) ] : https://www.postgresql.org/docs/13/index.html
148
- [ 12 ] : https://www.postgresql.org/docs/12/index.html
149
- [ 11 ] : https://www.postgresql.org/docs/11/index.html
150
- [ 10 ] : https://www.postgresql.org/docs/10/index.html
151
- [ 9.6 ] : https://www.postgresql.org/docs/9.6/index.html
152
143
153
144
# # Contributing
154
145
@@ -169,4 +160,3 @@ For professional support, please contact [Cybertec](https://www.cybertec-postgre
169
160
# # Star History
170
161
171
162
[](https:// star- history .com / # cybertec-postgresql/pg_timetable&Date)
172
-
0 commit comments