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 8DA579DCE1E for ; Thu, 2 Feb 2006 10:16:42 -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 60289-02 for ; Thu, 2 Feb 2006 10:16:44 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (serval.logix-tt.com [213.239.221.42]) by postgresql.org (Postfix) with ESMTP id AA0A79DCE1D for ; Thu, 2 Feb 2006 10:16:38 -0400 (AST) Received: from kingfisher.intern.logix-tt.com (Md470.m.pppool.de [89.49.212.112]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 14DEC244046; Thu, 2 Feb 2006 15:16:45 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 80D12181C209A; Thu, 2 Feb 2006 15:16:45 +0100 (CET) Message-ID: <43E2144D.4030901@logix-tt.com> Date: Thu, 02 Feb 2006 15:16:45 +0100 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Caune Cc: Owen Jacobson , pgsql-sql@postgresql.org Subject: Re: Does PostgreSQL support job? References: <1E293D3FF63A3740B10AD5AAD88535D201755923@UBIMAIL1.ubisoft.org> In-Reply-To: <1E293D3FF63A3740B10AD5AAD88535D201755923@UBIMAIL1.ubisoft.org> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.127 required=5 tests=[AWL=0.127] X-Spam-Score: 0.127 X-Spam-Level: X-Archive-Number: 200602/19 X-Sequence-Number: 24029 Hi, Daniel, Daniel Caune wrote: > I'm not sure to understand. Why calling a function from a script is different from executing a series of SQL commands? I mean, I can run a script defined as follows: > > SELECT myjob(); > > where myjob is a stored procedure such as: > > CREATE OR REPLACE FUNCTION myjob() > RETURNS void > AS $$ > > END; > $$ LANGUAGE PLPGSQL; > > Does that make sense? It does make sense if myjob() does more than just execute a bunch of statements, e. G. it contains if(), loops or something else. PLPGSQL is turing complete, plain SQL is not. Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org