简体   繁体   English

Azure PostgreSQL 灵活服务器 Cron 作业权限被拒绝

[英]Azure PostgreSQL Flexible Server Cron Job Permission Denied

I am trying to create and update a cron job on a Azure PostgreSQL Flex server.我正在尝试在 Azure PostgreSQL Flex 服务器上创建和更新 cron 作业。 I have pg_cron installed and I can create the job.我已经安装了 pg_cron,我可以创建工作。 But I am unable to update it.但我无法更新它。

select cron.schedule('0 9 * * 7', 'refresh materialized view sample_mv;');

The above works perfectly, I can see the job scheduled in the job table.以上工作完美,我可以看到作业表中安排的作业。 But when I try to run the below update statement, it fails with a "ERROR: permission denied for table job".但是,当我尝试运行以下更新语句时,它会失败并显示“错误:表作业的权限被拒绝”。

update cron.job set database = 'newdb' where jobid='3';

Any advice or guidance would be greatly appreciated!任何建议或指导将不胜感激!

In Azure Database for PostgreSQL Flexible Server, if you try to update the cron.job you will get an error as it requires superuser privileges.在 PostgreSQL 灵活服务器的 Azure 数据库中,如果您尝试更新 cron.job,您将收到一个错误,因为它需要超级用户权限。 However, you can try to use a workaround to make pg_cron jobs work on other databases and manage to do it this way:但是,您可以尝试使用一种变通方法使 pg_cron 作业在其他数据库上工作并设法这样做:

select cron.alter_job(job_id:=<your_job_id>,database:='<your_db_name>'); select cron.alter_job(job_id:=<your_job_id>,database:='<your_db_name>');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Bicep 更改 Azure PostgreSQL 灵活的服务器配置 - Changing Azure PostgreSQL flexible server configuration with Bicep Azure PostgreSQL 灵活服务器的数据库 Django 慢 - Azure Database for PostgreSQL flexible server Slow with Django 使用 .NET 核心 6 和 Azure SDK 创建 PostgreSQL 灵活服务器时出错 - Error on creation of a PostgreSQL flexible server with .NET core 6, and Azure SDK 是否可以拥有 azure 灵活 postgresql 服务器的只读副本和数据子集? - Is it possible to have a read replicas of azure flexible postgresql server with a subset of data? 添加 NSG 规则以在 Azure PostgreSQL 灵活服务器上启用高可用性 - Adding NSG rules to enable high availability on Azure PostgreSQL Flexible Server Azure 用于 PostgreSQL 灵活服务器部署的数据库因 databaseName 参数错误而失败 - Azure Database for PostgreSQL flexible server deployment fails with databaseName param error 无法连接到 PostgreSQL 服务器:无法连接到服务器:权限被拒绝 - Unable to connect to PostgreSQL server: could not connect to server: Permission denied postgresql:关系权限被拒绝 - postgresql: permission denied for relation PostgreSQL中对模式的权限被拒绝 - Permission denied on schema in PostgreSQL PostgreSQL中的权限被拒绝的异常 - Permission Denied exception in PostgreSQL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM