Daniel Caune wrote:
> Hi,
>
> I try to find in the documentation whether PostgreSQL supports job,
> but I miserably failed. Does PostgreSQL support job? If not, what
> is the mechanism mostly adopted by PostgreSQL administrators for
> running jobs against PostgreSQL? I was thinking about using
> cron/plsql/sql-scripts on Linux.
The answer really depends on what you mean by "jobs". If you have a database task that can be expressed as a series of
commandswith no interaction involved, you can just put those commands in a file (your-job-name.sql) and run it using
psqland cron:
# replace leading stars with cron time settings
* * * * * psql your-database -i your-job-name.sql
If you need something more complex, either a function which is executed from a script or a full-blown client program
maybe required. IME that's fairly rare.
-Owen