Since pg_cron is now supported in PostgreSQL 12 managed db, what would be the best way to use it if we have a database that is not defaultdb? Currently you can only install the pg_cron extension into defaultdb. Since pg_cron uses libpq, you can also run periodic jobs on other databases or other machines but you have to be a superuser so that is ruled out. Foreign Data Wrappers are the only other option I can see, but that seems like an unnecessary complication. I’d like to be able to just install the extension into my database but this requires modifying postgresql.conf to add cron.database_name.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.