AWS Security ChangesHomeSearch

AWS AmazonRDS: Use cron.schedule_in_database instead of manual two-step job update

Service: AmazonRDS · 2026-11-05 · Documentation low

File: AmazonRDS/latest/UserGuide/PostgreSQL_pg_cron.md

Summary

Rewrites the cross-database pg_cron instructions to use cron.schedule_in_database in one step, removing the manual UPDATE cron.job step and the note about jobs accidentally running in the default postgres database.

Security assessment

This is a correctness/usability improvement: scheduling directly in the target database avoids a job executing in the default database before being reassigned. It removes a note about a job potentially running in the wrong database, but no vulnerability, credential, or authorization boundary change is described.

Evidence

+Use the `cron.schedule_in_database` function to schedule a job that runs in another database within your PostgreSQL DB instance in a single step. This avoids the metadata database running the job before you reassign it. This function is available in `pg_cron` 1.4.0 and higher.

Diff

diff --git a/AmazonRDS/latest/UserGuide/PostgreSQL_pg_cron.md b/AmazonRDS/latest/UserGuide/PostgreSQL_pg_cron.md
index 91ac601..3e2daeb 100644
--- a//AmazonRDS/latest/UserGuide/PostgreSQL_pg_cron.md
+++ b//AmazonRDS/latest/UserGuide/PostgreSQL_pg_cron.md
@@ -162 +162 @@ Only users with `rds_superuser` role or `rds_superuser` privileges can list all
-  1. In the cron database, schedule the job as you normally do using the cron.schedule.
+Use the `cron.schedule_in_database` function to schedule a job that runs in another database within your PostgreSQL DB instance in a single step. This avoids the metadata database running the job before you reassign it. This function is available in `pg_cron` 1.4.0 and higher.
@@ -164 +164 @@ Only users with `rds_superuser` role or `rds_superuser` privileges can list all
-        postgres=> SELECT cron.schedule('database1 manual vacuum', '29 03 * * *', 'vacuum freeze test_table');
+  1. If you have the `rds_superuser` role, schedule the job directly in the target database by passing the database name as the final argument to `cron.schedule_in_database`.
@@ -166 +166 @@ Only users with `rds_superuser` role or `rds_superuser` privileges can list all
-  2. As a user with the `rds_superuser` role, update the database column for the job that you just created so that it runs in another database within your PostgreSQL DB instance.
+        postgres=> SELECT cron.schedule_in_database('database1 manual vacuum', '29 03 * * *', 'vacuum freeze test_table', 'database1');
@@ -168,3 +168 @@ Only users with `rds_superuser` role or `rds_superuser` privileges can list all
-        postgres=> UPDATE cron.job SET database = 'database1' WHERE jobid = 106;
-
-  3. Verify by querying the `cron.job` table.
+  2. Verify by querying the `cron.job` table.
@@ -182,4 +179,0 @@ Only users with `rds_superuser` role or `rds_superuser` privileges can list all
-###### Note
-
-In some situations, you might add a cron job that you intend to run on a different database. In such cases, the job might try to run in the default database (`postgres`) before you update the correct database column. If the user name has permissions, the job successfully runs in the default database.
-