X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B7B989DC99A for ; Thu, 2 Feb 2006 04:49:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 06587-07 for ; Thu, 2 Feb 2006 04:49:35 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx-2.sollentuna.net (mx-2.sollentuna.net [195.84.163.199]) by postgresql.org (Postfix) with ESMTP id EA11B9DC81E for ; Thu, 2 Feb 2006 04:49:32 -0400 (AST) Received: from ALGOL.sollentuna.se (janus.sollentuna.se [62.65.68.67]) by mx-2.sollentuna.net (Postfix) with ESMTP id BC2E98F28C; Thu, 2 Feb 2006 09:49:32 +0100 (CET) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: Re: Does PostgreSQL support job? Date: Thu, 2 Feb 2006 09:49:32 +0100 Message-ID: <6BCB9D8A16AC4241919521715F4D8BCE6C7F94@algol.sollentuna.se> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] Does PostgreSQL support job? Thread-Index: AcYngzMmD1Dxj/gDT0uMgRod2Ume3gAAEwngABRuVAA= From: "Magnus Hagander" To: "Daniel Caune" , "Owen Jacobson" , X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.093 required=5 tests=[AWL=0.093] X-Spam-Score: 0.093 X-Spam-Level: X-Archive-Number: 200602/17 X-Sequence-Number: 24027 > > > I try to find in the documentation whether PostgreSQL=20 > supports job,=20 > > > but I miserably failed. Does PostgreSQL support job? If=20 > not, what=20 > > > is the mechanism mostly adopted by PostgreSQL administrators for=20 > > > running jobs against PostgreSQL? I was thinking about using=20 > > > cron/plsql/sql-scripts on Linux. > >=20 > > The answer really depends on what you mean by "jobs". If=20 > you have a=20 > > database task that can be expressed as a series of commands with no=20 > > interaction involved, you can just put those commands in a file=20 > > (your-job- > > name.sql) and run it using psql and cron: > >=20 > > # replace leading stars with cron time settings > > * * * * * psql your-database -i your-job-name.sql > >=20 >=20 > Yes, that's it. A job is a task, i.e. set of statements,=20 > which is scheduled to run against a RDBMS at periodical=20 > times. Some RDBMS, such as SQL Server and Oracle, support=20 > that feature, even if such a feature is managed differently=20 > from a RDBMS to another. You could look at pgagent, which comes with pgAdmin3 (http://www.pgadmin.org/docs/1.4/pgagent.html). It does some scheduling that's a lot more advanced than you get from plain cron. And nice pgadmin integrated management of course. //Magnus