Reputation: 1
Is there a tool that will allow me to schedule Postgresql queries to run at regular intervals without being an Admin? I'm looking for solutions that would work on a Mac.
I only have write privileges (insert, update, delete) on certain schemas of the database but would like to schedule a query that runs on one of these schemas every day.
pgAgent is the obvious choice but I think I need to be an admin to use/install that.
Upvotes: 0
Views: 987
Reputation: 1
Is there a tool that will allow me to schedule Postgresql queries to run at regular intervals without being an Admin? I'm looking for solutions that would work on a Mac.
Use pg_cron
INSERT INTO cron.job (schedule, command, nodename, nodeport, database, username)
VALUES ('0 4 * * *', 'VACUUM', 'worker-node-1', 5432, 'postgres', 'marco');
this requires you to install the extension as an admin.
You can also run crontab -e
assuming it's supported by OSX. If you want to, as a regular user, set up a task to run (even non-DB tasks).
Upvotes: 1