pg_cron / seems job never executed
See original GitHub issueI tried to execute a simples CRON job with pg_cron by following the official tutorial https://supabase.io/blog/2021/03/05/postgres-as-a-cron-server and it’s not working for me.
Where I’m now: I have the pg_cron extension installed by supabase UI; I have the simplest CRON job which looks like
SELECT cron.schedule(
'* * * * *',
$$
DELETE FROM data
WHERE id=1
$$
);
if I execute SELECT * FROM cron.job;
I will get it in the list of scheduled jobs.
But at the end of the day, it never will be executed.
What I already try to do:
- disable/enable extension
- create a brand new project and redo steps following the guide
Any ideas on how I can handle this issue?
_Originally posted by @Miruzz in https://github.com/supabase/supabase/discussions/1628_
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Postgresql pg_cron job never executed - DBA Stack Exchange
The problem is that the job is never executed and I there is no error in the error log. Please advice how to...
Read more >Postgres 13 pg_cron error on RDS that's hard to track down
I'm working on getting pg_partman and pg_cron set up on RDS, but when my pg_cron jobs run, they return this error:
Read more >Databases: Postgresql pg_cron job never executed - YouTube
Databases: Postgresql pg_cron job never executedHelpful? Please support me on Patreon: https://www.patreon.com/roelvandepaarWith thanks ...
Read more >pg_cron : Probably the best way to schedule jobs within ...
You can't use pg_cron jobs to schedule a job in seconds interval. For example, you can't schedule a cron job to run every...
Read more >Cron job troubleshooting guide - Cronitor
Instant alerts when a job fails or never starts ... Cron jobs are run by a system daemon called crond that watches several...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey everyone 👋, finally found a quick remedy. Do follow this flow when using the
pg_cron
extension on the dashboard:0. [OPTIONAL] Drop all scheduled jobs and the pg_cron extension itself
1. Enable pg_cron
2. [IMPORTANT] Provide the following grants to the user
postgres
(and in the future any other user that would be using the cron schema). At the baseline, it seems pg_cron uses thepostgres
user when executing its schedule.3. Create sample table
test_table
4. Run a CRON job via pg_cron to add a row to this sample table
5. Observe that the table
test_table
is now being populated every minuteHey guys! Not much at the moment but we are inching towards finding the root cause. Sorry about that. We’ll update you on any major progress.