You can configure your recurring tasks by creating database jobs in PostgreSQL. PostgreSQL provides one external tool to configure sql job, name is PGAgent.
PGAgent is an external tool by the Postgres community which is used to create and manage database jobs.
Below is demonstration to configure PGAgent in a windows environment using PGAdmin.
How to configure PGAgent in PostgreSQL (windows) ?
Step 1 : download PGAgent using Stack Builder. Go to your postgres option menu where you can find one more link for Stack Builder. Now, as per below image select pgAgent and press Next.
Step 2: Now it will automatically download pgAgent so wait for few minutes and please make sure that your internet connection is working.
Step 3: After completion of download you can screen of PGAgent for further installation.
Step 4 : Configure authentication detail to access Postgres database server. Please note that PGAgent is only run under super user access. In below image postgres is super user of PostgreSQL Database Server.
Step 5 : Configure local postgres client password. You can visit this link for more details on client password location.
Step 6 : Now complete PGAgent installation and verify using PGAdmin. You can find one new pgAgent catalogs in postgres database. As marked below you can also find Job icon in main category.
Note : Only super user or administrator can create and manage this job. This icon is only visible to administrator login (postgres super user login.).
Step 7 : To create you first SQL Job. Right click on job and select to create new SQL Job. Give name of your job and prepare for next step. Make sure that job is Enabled.
Step 8: Create definition of job. Give name of step and define definition or action script into Definition tab. you can also select remote option when job is require to execute on remote machine.
Step 9: Now create a schedule to execute SQL Job. In this window you can select Days and times. Select all means at every minute, hour, day.
Now your PGAgent tool is configured and also we have created one Job to insert test data into table at every minute.
Please note : This PGAgent / Database Job is only create and manage by administrator and other database user can not even see this jobs.
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.