BUG #18918: cron.schedule_in_database ERROR: must be superuser to create a job for another role - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18918: cron.schedule_in_database ERROR: must be superuser to create a job for another role
Date
Msg-id 18918-b8729632b5e56dea@postgresql.org
Whole thread Raw
List pgsql-bugs
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


pgsql-bugs by date:

Previous
From: "Robin Haberkorn"
Date:
Subject: Re: BUG #18908: DEREF_OF_NULL: After having been assigned to a NULL value at descriptor.c:203
Next
From: PG Bug reporting form
Date:
Subject: BUG #18919: Source archives in ftp/source/v17.5 are missing