PgAgent, installation and configuration
PgAgent, in plain words, is like a “cron” but specifically for Postgres databases and a much more powerful level, a great help for carrying out scheduled jobs.
To install pgagent, for example from Debian, just run: apt-get install pgagent
Once on the computer we proceed to the real task, its configuration. First we have to make sure that we have the plpgsql language installed:
CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler VALIDATOR plpgsql_validator;