Обсуждение: 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