From c7ab4f72d3e63f9eb1228e5f0d15e4dcf846dd79 Mon Sep 17 00:00:00 2001 From: Maksym Buz Date: Mon, 30 Mar 2026 20:59:05 +0000 Subject: [PATCH] docs(procedures): refine zabbix monitor user instructions and pg_cron management section --- postgresql/procedures/README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/postgresql/procedures/README.md b/postgresql/procedures/README.md index 063edba..0ee3dcb 100644 --- a/postgresql/procedures/README.md +++ b/postgresql/procedures/README.md @@ -149,6 +149,12 @@ If you *must* connect via TCP with a specific database user and password, the `p chmod 0600 ~/.pgpass ``` +**Managing `pg_cron` Jobs:** +If you need to verify or manage your scheduled jobs (run as superuser): +- To **list all active schedules**: `SELECT * FROM cron.job;` +- To **view execution logs/history**: `SELECT * FROM cron.job_run_details;` +- To **remove/unschedule** the job: `SELECT cron.unschedule('zabbix_partition_maintenance');` + #### Option 2: Systemd Timers Systemd timers provide better logging and error handling properties than standard cron. @@ -199,13 +205,6 @@ If running in Docker, you can execute it via the host's cron by targeting the co 30 5,23 * * * docker exec zabbix-db-test psql -U zabbix -d zabbix -c "CALL partitions.run_maintenance();" ``` -### Managing `pg_cron` Jobs - -If you are using `pg_cron` for scheduling, you can verify and manage your jobs (run as superuser): -- To **list all active schedules**: `SELECT * FROM cron.job;` -- To **view execution logs/history**: `SELECT * FROM cron.job_run_details;` -- To **remove/unschedule** the job: `SELECT cron.unschedule('zabbix_partition_maintenance');` - ## Monitoring & Permissions System state can be monitored via the `partitions.monitoring` view. It includes the information about number of future partitions and the time since the last maintenance run. Plus it includes the total size of the partitioned table in bytes.