pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: silvanlaube@hotmail.com
Subject: BUG #18918: cron.schedule_in_database ERROR: must be superuser to create a job for another role
Date: Thu, 08 May 2025 15:54:53 +0000
Message-ID: <18918-b8729632b5e56dea@postgresql.org> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <18918-b8729632b5e56dea@postgresql.org>
Permalink:  ../18918-b8729632b5e56dea@postgresql.org/
Also on:    postgresql.org/message-id/18918-b8729632b5e56dea@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, silvanlaube@hotmail.com
  Subject: Re: BUG #18918: cron.schedule_in_database ERROR: must be superuser to create a job for another role
  In-Reply-To: <18918-b8729632b5e56dea@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox