I have 2 alloydbsuperusers and I have enabled database_flag alloydb.enable_pg_cron to on.
When i log in via a compute engine and use psql, i can connect successfully from both users to my database but when i try to edit or alter postgresql.conf for setting cron.database_name =“my_db” it says permission denied.
And same for creating extension.
my_db=> ALTER SYSTEM SET cron.database_name = ‘my_db’;
ERROR: permission denied to set parameter “cron.database_name”
my_db=> CREATE EXTENSION pg_cron;
ERROR: can only create extension in database postgres
DETAIL: Jobs must be scheduled from the database configured in cron.database_name, since the pg_cron background worker reads job descriptions from this database.
HINT: Add cron.database_name = ‘my_db’ in postgresql.conf to use the current database.
CONTEXT: PL/pgSQL function inline_code_block line 4 at RAISE
my_db=> \q
Ultimately i just want to create extension for pg_cron in my_db database on alloydb and run cron queries. How do i achieve it?