Unable to use function schedule_in_database using azure_pg_admin

Choppakatla, Sasi Kiran 0 Reputation points
2025-01-07T04:55:54.2833333+00:00

Dear Azure community,

 

We have recently subscribed to Azure PostgreSQL 16 from SAP BTP for Production instance. However, we have not been able to use cron function "schedule_in_database" to schedule jobs.

We are facing the below permission denied error while trying to run the cron scheduler using admin user which is a member of "azure_pg_admin".

 User's image

 User's image

We did not face this problem earlier with our non-production instance which was setup few months ago. 

We understand that the issue is related to a known recent bug which was already identified by Azure team and mentioned in the below link.

https://learn.microsoft.com/en-us/answers/questions/2121382/postgre-sql-flexible-server-pg-cron-permissions-is

Kindly advise on how to get necessary privileges granted to execute the schedule_in_database function.

 

Regards,

Sasi Kiran

Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. ShaktiSingh-MSFT 16,236 Reputation points
    2025-01-23T05:52:33.77+00:00

    Hi @Choppakatla, Sasi Kiran ,

    Thanks for your patience.

    As discussed over private message, please try:

    postgres=# GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA cron TO azure_pg_admin WITH GRANT OPTION;

    GRANT

    Permission has been granted to azure_pg_admin, now you can grant it to whoever you like for using the functions.

    Let me know if you have more queries.

    Thanks

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.