Hi, @Mani Mahesh Sivakumar Thanks for the ask and for using the Microsoft Q&A platform.
If my understanding is correct you want to know if pg_cron allows scheduling a cron job for a database other than the one it was created in
pg_cron can only run in Postgres DB and Azure Postgres Flexible server doesn't support it on another database different than Postgres DB.
As a workaround on FSPG is to set up a cross-reference database with DBLINK to connect back to the local database. however, this will make it harder to develop code and complicate the database administration
Please, refer to the link for more information about DBLINK
-- Schedule query that returns results
SELECT cron.schedule('select-1-in-other', '* * * * *', $$
select * from dblink('host=xxxx-test.postgres.database.azure.com user=xxxx dbname=other password=MyPass', 'select 1') as res (x int);
$$);
I hope this information helps, let me know if you have any additional questions.
Regards
Geetha