跳到正文

pg_cron 兼容性

数据库内建 Cron 定时任务调度器,常用于定时刷新物化视图、分区维护与过期数据清理。

CREATE EXTENSION pg_cron;

版本证据核验日期

  • Amazon RDS 需要在参数组的 shared_preload_libraries 中加入 pg_cron,并确认安装角色权限。 安装文档
  • Neon 的任务只在计算实例活跃时运行。 运行条件
云产品PG 版本扩展版本限制与文档
NeonPG 19扩展 1.6Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档
NeonPG 18扩展 1.6Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档
NeonPG 17扩展 1.6Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档
NeonPG 16扩展 1.6Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档
NeonPG 15扩展 1.6Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档
NeonPG 14扩展 1.6Prefer scheduled Function Triggers; pg_cron runs only while the compute is active, so it needs scale to zero disabled. 文档
AWS RDSPG 12.5+扩展 按引擎次版本 / By engine minor通过参数组配置 shared_preload_libraries,并确认安装角色权限。 文档
查看各平台支持情况
查询实例上的版本
SELECT version();
SELECT version, installed FROM pg_available_extension_versions
WHERE name = 'pg_cron';
全部扩展兼容矩阵