docs: restructure documentation and add invalid transaction termination exception
This commit is contained in:
@@ -87,6 +87,9 @@ If you use a visual database manager, simply open each file in your query editor
|
||||
|
||||
Partitioning requires a daily job to create new partitions for tomorrow and drop old partitions from last month.
|
||||
|
||||
> [!WARNING]
|
||||
> **CRITICAL EXECUTION RULE**: You MUST execute the maintenance procedure as a standalone command exactly as shown below. **DO NOT** wrap it in a transaction block (`BEGIN; ... COMMIT;`) or batch it with other SQL commands in a single string, or it will crash with an `invalid transaction termination` error.
|
||||
|
||||
If you are using **AWS RDS** or a managed database with `pg_cron` enabled, run this inside `psql`:
|
||||
|
||||
```sql
|
||||
@@ -94,7 +97,12 @@ CREATE EXTENSION IF NOT EXISTS pg_cron;
|
||||
SELECT cron.schedule('zabbix_partition_maintenance', '30 5,23 * * *', 'CALL partitions.run_maintenance();');
|
||||
```
|
||||
|
||||
*(If you are self-hosting and don't have `pg_cron`, please refer to the `README.md` for instructions on setting up standard OS `cron` or systemd timers.)*
|
||||
If you are **self-hosting** and prefer standard system `cron`, simply add this to your `crontab -e`:
|
||||
|
||||
```bash
|
||||
# Run Zabbix partition maintenance twice daily (5:30 AM and 11:30 PM)
|
||||
30 5,23 * * * psql -U postgres -d zabbix -c "CALL partitions.run_maintenance();" >> /var/log/zabbix_maintenance.log 2>&1
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -106,7 +114,7 @@ Now that the database is fully partitioned, you can safely start Zabbix Server a
|
||||
sudo systemctl start zabbix-server
|
||||
```
|
||||
|
||||
*(Note: Your old history data remains in tables like `history_old`. It is no longer visible in the UI. If you need it, you must manually insert it into the new tables. See `README.md` for more details.)*
|
||||
*(Note: Your old history data remains safely preserved in tables like `history_old`. It is no longer visible in the UI, but it is available in the database if you ever need to manually migrate it.)*
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user