【发布时间】:2022-07-05 17:46:16
【问题描述】:
我正在尝试使用 pg_cron 在 Postgres Cloud SQL 实例中的多个 DB 上安排对存储过程的调用。
不幸的是,pg_cron 似乎只能在 postgres DB 上创建
当我尝试在不同于 postgres 的数据库上使用 pg_cron 时,我收到以下消息:
CREATE EXTENSION pg_cron;
ERROR: can only create extension in database postgres
Detail: Jobs must be scheduled from the database configured in
cron.database_name, since the pg_cron background worker reads job
descriptions from this database. Hint: Add cron.database_name =
'mydb' in postgresql.conf to use the current database.
Where: PL/pgSQL function inline_code_block line 4 at RAISE
Query = CREATE EXTENSION pg_cron;
...我认为我无法访问 Cloud SQL 中的 postgresql.conf ...还有其他方法吗? 也许我可以使用 postgres_fdw 来实现我的目标?
谢谢,
【问题讨论】:
标签: postgresql google-cloud-platform google-cloud-sql pg-cron