I have several pgAgent jobs that run on the ‘master’ database. They fail on the replica since it’s a ‘read-only’ connection. I’m creating a couple jobs to run some bash scripts but I don’t want them to run on the replica server.
Is there a way to prevent pgAgent jobs from executing on the replica server? Wrap all the jobs in an ‘if’ statement to check if the server is in_recovery? Disable the daemon on the replica server?
I’m currently running PostgreSQL 11 with pgAgent 4.