BUG #18918: cron.schedule_in_database ERROR: must be superuser to create a job for another role
The following bug has been logged on the website:
Bug reference: 18918
Logged by: Silvan Laube
Email address: silvanlaube@hotmail.com
PostgreSQL version: 16.8
Operating system: whatever Azure uses
Description:
This throws an "ERROR: must be superuser to create a job for another role"
SELECT cron.schedule_in_database(
'refresh_mv',
'30 5 * * *',
'REFRESH MATERIALIZED VIEW schema.my_view;',
'my-db',
current_user, -- or specified as 'my_user'
true
);
but this will work, and schedule the job as current_user:
SELECT cron.schedule_in_database(
'refresh_mv',
'30 5 * * *',
'REFRESH MATERIALIZED VIEW schema.my_view;',
'my-db'
);
seems unintended and extremely confusing
On Thursday, May 8, 2025, PG Bug reporting form <noreply@postgresql.org>
wrote:
The following bug has been logged on the website:
Bug reference: 18918
Logged by: Silvan Laube
Email address: silvanlaube@hotmail.com
PostgreSQL version: 16.8
Operating system: whatever Azure uses
Description:This throws an "ERROR: must be superuser to create a job for another role"
SELECT cron.schedule_in_database(
There is no function with that name in the core community PostgreSQL
distribution. You should report this wherever the people who created that
extension are expecting to see bug reports filed.
David J.
Right, sorry, forgot pg_cron is an extension. Reported here: https://github.com/citusdata/pg_cron/issues/390
________________________________
Von: David G. Johnston <david.g.johnston@gmail.com>
Gesendet: Donnerstag, 8. Mai 2025 20:17
An: silvanlaube@hotmail.com <silvanlaube@hotmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Betreff: Re: BUG #18918: cron.schedule_in_database ERROR: must be superuser to create a job for another role
On Thursday, May 8, 2025, PG Bug reporting form <noreply@postgresql.org<mailto:noreply@postgresql.org>> wrote:
The following bug has been logged on the website:
Bug reference: 18918
Logged by: Silvan Laube
Email address: silvanlaube@hotmail.com<mailto:silvanlaube@hotmail.com>
PostgreSQL version: 16.8
Operating system: whatever Azure uses
Description:
This throws an "ERROR: must be superuser to create a job for another role"
SELECT cron.schedule_in_database(
There is no function with that name in the core community PostgreSQL distribution. You should report this wherever the people who created that extension are expecting to see bug reports filed.
David J.