0

I want to run a query all X seconds on my PostgreSQL database (9.5 on Windows Systems).

I read that you can use Background Jobs to achieve this.

The pgAgent Jobs (https://www.pgadmin.org/docs/1.4/pgagent-jobs.html) are a good explanation on how to do this.

However on the installation page (https://www.pgadmin.org/docs/1.4/pgagent-install.html) they mention the security concerns about storing the password on the server / connection string.

Is there another way to run a query all X seconds on the database? Maybe there is an extension that works like oracle jobs?

  • Which operating system are you using ? – Sahap Asci Jun 16 '16 at 9:53
  • Windows 2012 R2 and Windows 10 – Tommy Jun 16 '16 at 9:54
  • There are several different authentication methods you could try - depends on your specific setup and needs that might be more secure. However, if someone is already on your database server you probably have bigger issues :) – LowlyDBA Jun 16 '16 at 14:36
1

There are lots of ways to run a scheduled job. One of them is using pgAgent. For windows you can store your password in %APPDATA%\postgresql\pgpass.conf file. Here you can find details. You can also add trust to specific ip and user from server side by changing pg_hba.conf file

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.