Skip to content

Commit e847351

Browse files
committed
Update concepts-extensions.md
1 parent f730a55 commit e847351

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

articles/postgresql/flexible-server/concepts-extensions.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ To delete old data on Saturday at 3:30am (GMT)
377377
```
378378
SELECT cron.schedule('30 3 * * 6', $$DELETE FROM events WHERE event_time < now() - interval '1 week'$$);
379379
```
380-
To run vacuum every day at 10:00am (GMT)
380+
To run vacuum every day at 10:00am (GMT) in default database 'postgres'
381381
```
382382
SELECT cron.schedule('0 10 * * *', 'VACUUM');
383383
```
@@ -386,6 +386,15 @@ To unschedule all tasks from pg_cron
386386
```
387387
SELECT cron.unschedule(jobid) FROM cron.job;
388388
```
389+
To see all jobs currently scheduled with pg_cron
390+
```
391+
SELECT * FROM cron.job;
392+
```
393+
To run vaccuum every day at 10:00 am (GMT) in database 'testcron' under pg_admin role account
394+
```
395+
SELECT cron.schedule_in_database('VACUUM','0 10 * * * ','VACUUM','testcron',null,TRUE)
396+
```
397+
389398
> [!NOTE]
390399
> pg_cron extension is preloaded in every Azure Database for PostgreSQL -Flexible Server inside postgres database to provide you with ability to schedule jobs to run in other databases within your PostgreSQL DB instance without compromising security.
391400

0 commit comments

Comments
 (0)