pg_cron 兼容性
数据库内建 Cron 定时任务调度器,常用于定时刷新物化视图、分区维护与过期数据清理。
CREATE EXTENSION pg_cron;
版本证据核验日期
| 云产品 | PG 版本 | 扩展版本 | 限制与文档 |
|---|---|---|---|
| Neon | PG 19 | 扩展 1.6 | Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档 |
| Neon | PG 18 | 扩展 1.6 | Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档 |
| Neon | PG 17 | 扩展 1.6 | Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档 |
| Neon | PG 16 | 扩展 1.6 | Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档 |
| Neon | PG 15 | 扩展 1.6 | Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档 |
| Neon | PG 14 | 扩展 1.6 | Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档 |
| AWS RDS | PG 12.5+ | 扩展 按引擎次版本 / By engine minor | 通过参数组配置 shared_preload_libraries,并确认安装角色权限。 文档 |
查看各平台支持情况
查询实例上的版本
SELECT version(); SELECT version, installed FROM pg_available_extension_versions WHERE name = 'pg_cron';