Closed chrislungu closed 3 weeks ago
Kinda late, but it seems clear
However, if you want to run a cron job across multiple databases you would use cron.schedule_in_database()
instead of cron.schedule()
.
But jobs must be scheduled from the database configured in cron.database_name
config param in postgresql.conf
, since the pg_cron background worker reads job descriptions from that database.
cron.schedule_in_database()
just has an extra param, which is the database name where the job should run.
Example of scheduling across databases from the docs:
thanks, it's clear!
hi all,
I just want to confirm something, the documentation is not best (sorry). it says the following:
may I confirm that this means, in practice, that if I install pg_cron in the database "postgres" and I have additional databases on the same server, I can use pg_cron to schedule jobs across the entire server, i.e. in other databases?
thank you