{"id":13412108,"url":"https://github.com/cybertec-postgresql/pg_timetable","last_synced_at":"2025-05-14T17:09:17.296Z","repository":{"id":37416496,"uuid":"162420527","full_name":"cybertec-postgresql/pg_timetable","owner":"cybertec-postgresql","description":"pg_timetable: Advanced scheduling for PostgreSQL","archived":false,"fork":false,"pushed_at":"2025-05-05T09:29:52.000Z","size":3887,"stargazers_count":1157,"open_issues_count":0,"forks_count":66,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-05-05T10:29:39.000Z","etag":null,"topics":["chains","cron","database","docker-image","interval","pg-timetable","postgresql","postgresql-frontend","scheduling","sql"],"latest_commit_sha":null,"homepage":"https://www.cybertec-postgresql.com/en/products/pg_timetable/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cybertec-postgresql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-19T10:19:51.000Z","updated_at":"2025-05-05T09:17:02.000Z","dependencies_parsed_at":"2023-09-27T13:12:49.744Z","dependency_job_id":"985b4501-e0c5-4902-a16b-5e6f4e92c1c5","html_url":"https://github.com/cybertec-postgresql/pg_timetable","commit_stats":{"total_commits":1028,"total_committers":25,"mean_commits":41.12,"dds":"0.21303501945525294","last_synced_commit":"b5d06b93dff03ae6f9e69eeee1e2f9dcd92a510f"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybertec-postgresql%2Fpg_timetable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybertec-postgresql%2Fpg_timetable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybertec-postgresql%2Fpg_timetable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybertec-postgresql%2Fpg_timetable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cybertec-postgresql","download_url":"https://codeload.github.com/cybertec-postgresql/pg_timetable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254190396,"owners_count":22029632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chains","cron","database","docker-image","interval","pg-timetable","postgresql","postgresql-frontend","scheduling","sql"],"created_at":"2024-07-30T20:01:21.058Z","updated_at":"2025-05-14T17:09:17.289Z","avatar_url":"https://github.com/cybertec-postgresql.png","language":"Go","readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n![Build \u0026 Test](https://github.com/cybertec-postgresql/pg_timetable/workflows/Go%20Build%20\u0026%20Test/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/cybertec-postgresql/pg_timetable/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/cybertec-postgresql/pg_timetable?branch=master)\n[![Documentation Status](https://readthedocs.org/projects/pg-timetable/badge/?version=master)](https://pg-timetable.readthedocs.io/en/master/?badge=master)\n[![Release](https://img.shields.io/github/v/release/cybertec-postgresql/pg_timetable?include_prereleases)](https://github.com/cybertec-postgresql/pg_timetable/releases)\n[![Github All Releases](https://img.shields.io/github/downloads/cybertec-postgresql/pg_timetable/total?style=flat-square)](https://github.com/cybertec-postgresql/pg_timetable/releases)\n[![Docker Pulls](https://img.shields.io/docker/pulls/cybertecpostgresql/pg_timetable)](https://hub.docker.com/r/cybertecpostgresql/pg_timetable)\n[![Go Report Card](https://goreportcard.com/badge/github.com/cybertec-postgresql/pg_timetable)](https://goreportcard.com/report/github.com/cybertec-postgresql/pg_timetable)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\n# pg_timetable: Advanced scheduling for PostgreSQL\n\n**pg_timetable** is an advanced standalone job scheduler for PostgreSQL, offering many advantages over traditional schedulers such as **cron** and others.\nIt is completely database driven and provides a couple of advanced concepts. It allows you to schedule PostgreSQL commands, system programs and built-in operations:\n\n```sql\n-- Run public.my_func() at 00:05 every day in August:\nSELECT timetable.add_job('execute-func', '5 0 * 8 *', 'SELECT public.my_func()');\n\n-- Run VACUUM at minute 23 past every 2nd hour from 0 through 20 every day:\nSELECT timetable.add_job('run-vacuum', '23 0-20/2 * * *', 'VACUUM');\n\n-- Refresh materialized view every 2 hours:\nSELECT timetable.add_job('refresh-matview', '@every 2 hours', \n  'REFRESH MATERIALIZED VIEW public.mat_view');\n\n-- Clear log table after pg_timetable restart:\nSELECT timetable.add_job('clear-log', '@reboot', 'TRUNCATE public.log');\n\n-- Reindex at midnight on Sundays with reindexdb utility:\n\n--  using default database under default user (no command line arguments)\nSELECT timetable.add_job('reindex-job', '0 0 * * 7', 'reindexdb', job_kind := 'PROGRAM');\n\n--  specifying target database and tables, and be verbose\nSELECT timetable.add_job('reindex-job', '0 0 * * 7', 'reindexdb',\n          '[\"--table=foo\", \"--dbname=postgres\", \"--verbose\"]'::jsonb, 'PROGRAM');\n\n--  passing password using environment variable through bash shell\nSELECT timetable.add_job('reindex-job', '0 0 * * 7', 'bash',\n    '[\"-c\", \"PGPASSWORD=5m3R7K4754p4m reindexdb -U postgres -h 192.168.0.221 -v\"]'::jsonb,\n    'PROGRAM');    \n```\n\n## Documentation\n\n\u003chttps://pg-timetable.readthedocs.io/\u003e\n\n## Main features\n\n- Tasks can be arranged in chains\n- Each task executes SQL, built-in or executable command\n- Parameters can be passed to tasks\n- Missed chains (possibly due to downtime) can be retried automatically\n- Support for configurable repetitions\n- Builtin tasks such as sending emails, downloading, importing files, etc.\n- Fully database driven configuration\n- Full support for database driven logging\n- Enhanced cron-style scheduling\n- Optional concurrency protection\n\n## [Installation](https://pg-timetable.readthedocs.io/en/master/installation.html)\n\nComplete installation guide can be found in the [documentation](https://pg-timetable.readthedocs.io/en/master/installation.html).\n\nPossible choices are:\n\n- official [release packages](https://github.com/cybertec-postgresql/pg_timetable/releases);\n- [Docker images](https://hub.docker.com/r/cybertecpostgresql/pg_timetable);\n- [build from sources](https://pg-timetable.readthedocs.io/en/master/installation.html#build-from-sources).\n\n## [Quick Start](https://pg-timetable.readthedocs.io/en/master/README.html#quick-start)\n\nComplete usage guide can be found in the [documentation](https://pg-timetable.readthedocs.io/en/master/basic_jobs.html).\n\n1. Download **pg_timetable** executable\n\n1. Make sure your **PostgreSQL** server is up and running and has a role with `CREATE` privilege for a target database, e.g.\n\n    ```sql\n    my_database=\u003e CREATE ROLE scheduler PASSWORD 'somestrong';\n    my_database=\u003e GRANT CREATE ON DATABASE my_database TO scheduler;\n    ```\n\n1. Create a new job, e.g. run `VACUUM` each night at 00:30\n\n    ```sql\n    my_database=\u003e SELECT timetable.add_job('frequent-vacuum', '30 0 * * *', 'VACUUM');\n    add_job\n    ---------\n        3\n    (1 row)\n    ```\n\n1. Run the pg_timetable\n\n    ```terminal\n    pg_timetable postgresql://scheduler:somestrong@localhost/my_database --clientname=vacuumer\n    ```\n\n1. PROFIT!\n\n## Supported Environments  \n\n| Cloud Service    | Supported | PostgreSQL Version  | Supported | OS | Supported |\n| ---------------- |:---------:| ------------------- |:---------:| -- |:---------:|\n| [Alibaba Cloud]  | ✅       | [18 (devel)]         | ✅       | Linux     | ✅ |\n| [Amazon RDS]     | ✅       | [17 (current)]       | ✅       | Darwin    | ✅ |\n| [Amazon Aurora]  | ✅       | [16]                 | ✅       | Windows   | ✅ |\n| [Azure]          | ✅       | [15]                 | ✅       | FreeBSD\\* | ✅ |\n| [Citus Cloud]    | ✅       | [14]                 | ✅       | NetBSD\\*  | ✅ |\n| [Crunchy Bridge] | ✅       | [13]                 | ✅       | OpenBSD\\* | ✅ |\n| [DigitalOcean]   | ✅       | [12]                 | ✅       | Solaris\\* | ✅ |\n| [Google Cloud]   | ✅       | [11]                 | ✅       |           |     |\n| [Heroku]         | ✅       | [10]                 |          |           |     |\n| [Supabase]       | ✅       |                      |          |           |     |\n| [Tembo]          | ✅       |                      |          |           |     |\n\n\\* - 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).\n\n\\** - previous PostgreSQL versions may and should work smoothly. Only [officially supported PostgreSQL versions](https://www.postgresql.org/support/versioning/) are listed in this table.\n\n[Alibaba Cloud]: https://www.alibabacloud.com/help/doc-detail/96715.htm\n[Amazon RDS]: https://aws.amazon.com/rds/postgresql/\n[Amazon Aurora]: https://aws.amazon.com/rds/aurora/\n[Azure]: https://azure.microsoft.com/en-us/services/postgresql/\n[Citus Cloud]: https://www.citusdata.com/product/cloud\n[Crunchy Bridge]: https://www.crunchydata.com/products/crunchy-bridge/\n[DigitalOcean]: https://www.digitalocean.com/products/managed-databases/\n[Google Cloud]: https://cloud.google.com/sql/docs/postgres/\n[Heroku]: https://elements.heroku.com/addons/heroku-postgresql\n[Supabase]: https://supabase.io/docs/guides/database\n[Tembo]: https://cloud.tembo.io/\n[18 (devel)]: https://www.postgresql.org/docs/devel/index.html\n[17 (current)]: https://www.postgresql.org/docs/17/index.html\n[16]: https://www.postgresql.org/docs/16/index.html\n[15]: https://www.postgresql.org/docs/15/index.html\n[14]: https://www.postgresql.org/docs/14/index.html\n[13]: https://www.postgresql.org/docs/13/index.html\n[12]: https://www.postgresql.org/docs/12/index.html\n[11]: https://www.postgresql.org/docs/11/index.html\n[10]: https://www.postgresql.org/docs/10/index.html\n\n## Contributing\n\nIf you want to contribute to **pg_timetable** and help make it better, feel free to open an [issue][issue] or even consider submitting a [pull request][PR].\n\n[issue]: https://github.com/cybertec-postgresql/pg_timetable/issues\n[PR]: https://github.com/cybertec-postgresql/pg_timetable/pulls\n\n## Support\n\nFor professional support, please contact [Cybertec](https://www.cybertec-postgresql.com/).\n\n## Authors\n\n- Implementation: [Pavlo Golub](https://github.com/pashagolub)\n- Initial idea and draft design: [Hans-Jürgen Schönig](https://github.com/postgresql007)\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=cybertec-postgresql/pg_timetable\u0026type=Date)](https://star-history.com/#cybertec-postgresql/pg_timetable\u0026Date)\n","funding_links":[],"categories":["Go","Database","Generators","数据库","Data Integration Frameworks","Uncategorized","数据库  `go语言实现的数据库`","Utilities"],"sub_categories":["Advanced Console UIs","Database Tools","数据库工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcybertec-postgresql%2Fpg_timetable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcybertec-postgresql%2Fpg_timetable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcybertec-postgresql%2Fpg_timetable/lists"}