Questions tagged [pg-cron]
30 questions
0
votes
1 answer
How to setup a cron in pg_cron to run every 90 seconds
I want to a cron in database using pg_cron to update the value every 90 seconds.
i am looking at this solutions
Can a cron job run every 'x' seconds
but this is not correct way.
also i am looking at Cron job to run a PHP script every 90 seconds…

Dharmendra Soni
- 145
- 1
- 4
- 9
0
votes
0 answers
Install pg_cron extension on Postgres:13-alpine docker image
I am trying to implement a cron job on my Postgres DB using the pg_cron extension
but getting the following error which implies pg_cron extension is not installed on the Postgres:13-alpine image I am using :
Reason:…

ah_ben
- 85
- 7
0
votes
0 answers
Customize pg_cron return_message
Is there a way to customize the return_message of cron.job_run_details?
I need a more descriptive return_message than just SELECT 1.
In my case, the cron job uses dblink to make a call to functions in other databases:
example:
SELECT * FROM…

homam
- 1,945
- 1
- 19
- 26
0
votes
0 answers
Add pg_cron extension to postgres13alpine image
I have a problem with adding pg_cron extension to the postgres: 13.4-alpine3.14 docker image and I totally stuck on it: /
What I was trying to do:
I performed a simple Dockerfile to build an image with the needed extension:
FROM…

msmells
- 31
- 2
0
votes
0 answers
pg_cron for PostgreSQL 12 stops working with message LOG: cron job 1 job startup timeout
I have set up pg_cron on PostgreSQL 12. It was working properly. Suddenly it stops working with message LOG: cron job 1 job startup timeout.
I have tried below options still same message.
I have restarted PostgreSQL service.
Tried to create new…

Darshan Shah
- 157
- 1
- 1
- 15
0
votes
1 answer
Azure PostgreSQL Flexible Server Cron Job Permission Denied
I am trying to create and update a cron job on a Azure PostgreSQL Flex server. I have pg_cron installed and I can create the job. But I am unable to update it.
select cron.schedule('0 9 * * 7', 'refresh materialized view sample_mv;');
The above…

QuantumPhysGuy
- 416
- 5
- 18
0
votes
1 answer
Unable to get pg_settings from non-postgres user
I have the following query to get the settings for max_running_jobs.
select *
from pg_settings
where name = 'cron.max_running_jobs';
I'm able to get the records from postgres user but not with the non-postgres user.
Any grant/permission I got…

MAK
- 6,824
- 25
- 74
- 131
0
votes
1 answer
Get maximum number of job slaves per instance that can be created for the execution in PostgreSQL
I am migrating oracle database to postgresql.
While migration came to know with the following query in the oracle side.
Oracle Query:
SELECT
TRIM(value) AS val
FROM v$parameter
WHERE name = 'job_queue_processes';
I just want to know how can we get…

MAK
- 6,824
- 25
- 74
- 131
0
votes
1 answer
How do I chain a VACUUM off of a purge routine running with pg_cron?
Postgres 13.4
I've got some pg_cron jobs set up to periodically delete older records out of log-like files. What I'd like to do is to run VACUUM ANALYZE after performing a purge. Unfortunately, I can't work out how to do this in a stored function.…

Morris de Oryx
- 1,857
- 10
- 28
0
votes
1 answer
Postgres 13 pg_cron error on RDS that's hard to track down
pg_cron jobs all fail with "role of....doesn't provide permission to schedule a job"
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:
ERROR: The protected role of rds_super doesn't…

Morris de Oryx
- 1,857
- 10
- 28
0
votes
1 answer
Is using "pg_sleep" in plpgsql Procedures/Functions while using multiple worker background processes concurrently bad practice?
I am running multiple background worker processes in my Postgres database. I am doing this using Pg_Cron extension. I cannot unfortunately use Pg_Timetables, as suggested by another user here.
Thus, I have 5 dependent "Jobs" that need 1 other…

ennth
- 1,698
- 5
- 31
- 63
0
votes
0 answers
Trigger Pg_Cron Job by something other than a Cron Expression?
I am using Pg_Cron to run some automated Functions/Procedures using plpgsql.
One of my jobs is to do a SELECT... on some tables and gather up some Keys (PK/FK) of records that I need to delete. However, I had some other jobs that are dependent on…

ennth
- 1,698
- 5
- 31
- 63
0
votes
1 answer
How to install pg_cron on Big Sur Apple M1?
I am trying to install pg_cron on my local machine Big Sur M1 for development https://github.com/citusdata/pg_cron
I cannot find any instructions on how to install this on M1
sudo yum install -y pg_cron_12 does not work
sudo apt-get -y install…

PirateApp
- 5,433
- 4
- 57
- 90
0
votes
1 answer
Enabling pg_cron extension on postgres database without rds_superuser
I'm trying to follow this article to enable the pg_cron extension on my postgres RDS instance on AWS:
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL_pg_cron.html
it says to run on the rds_superuser
CREATE EXTENSION…

ennth
- 1,698
- 5
- 31
- 63
0
votes
1 answer
Schema for pg_cron when initializing the extension
I'm trying to initialize the pg_cron extension in a dedicated schema named 'cron'.
I usually create the schema before creating the extension but something goes wrong in this case:
db_dev# CREATE SCHEMA cron;
CREATE SCHEMA
db_dev# CREATE EXTENSION…

fstephany
- 2,254
- 3
- 25
- 32