This article is half-done without your Comment! *** Please share your thoughts via Comment ***
You can configure recurring tasks by creating database jobs in PostgreSQL.
PostgreSQL provides one external tool to configure SQL job; the name is PGAgent.
PGAgent is an external tool by the Postgres community which is used to create and manage database jobs.
Below is a demonstration for configuring 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 running under super user access. In below image, Postgres is a 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 the 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 the job and select to create new SQL Job. Give the name of your job and prepare for next step. Make sure that job is Enabled.
Step 8: Create definition of job. Give the name of step and define definition or action script into Definition tab. You can also select the remote option when the job is required to execute on the 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 created and manage by administrator and another database user can not even see this jobs.