X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 6F4969FA1B0 for ; Sun, 7 May 2006 20:46:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 54941-05 for ; Sun, 7 May 2006 20:46:15 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.231]) by postgresql.org (Postfix) with ESMTP id 548969F9AFD for ; Sun, 7 May 2006 20:46:15 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id i30so889588wra for ; Sun, 07 May 2006 16:46:14 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:x-virus-scanned; b=HPlrTUSkTgRAo3hafc3DWyDFHED84U64ah23WHUXzKkwyrXn3GDw5oueMRMNNIIA+c8iQAalkU6H7C14aU9m0b+67IV/Oy4iJLbTBA1YmVQCK1lS7UPGzqStXsdeA4SJX6mX3aXSAosoXBtqM6Byfg7ZvFKOnmRPR1QPNlcJETM= Received: by 10.54.146.17 with SMTP id t17mr1625085wrd; Sun, 07 May 2006 16:46:14 -0700 (PDT) Received: from strongwill.g2ctech ( [201.22.40.161]) by mx.gmail.com with ESMTP id 29sm2037495wrl.2006.05.07.16.46.12; Sun, 07 May 2006 16:46:13 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by strongwill.g2ctech (Postfix) with ESMTP id ED9E822BB1; Sun, 7 May 2006 20:46:08 -0300 (BRT) Received: from strongwill.g2ctech ([127.0.0.1]) by localhost (strongwill [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25871-02-2; Sun, 7 May 2006 20:46:08 -0300 (BRT) Received: from jupiter.g2ctech (unknown [10.0.0.240]) by strongwill.g2ctech (Postfix) with ESMTP id CEEF022B50; Sun, 7 May 2006 20:46:08 -0300 (BRT) Received: from localhost (localhost [IPv6:::1]) by jupiter.g2ctech (Postfix) with ESMTP id CC1E14D5AD; Sun, 7 May 2006 20:46:07 -0300 (BRT) From: Jorge Godoy To: pgsql-sql@postgresql.org Subject: Re: Creating nested functions with plpgsql Date: Sun, 7 May 2006 20:46:04 -0300 User-Agent: KMail/1.9.1 References: <200605021414.49661.jgodoy@gmail.com> <20060507233343.GC31301@surnet.cl> In-Reply-To: <20060507233343.GC31301@surnet.cl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605072046.05629.jgodoy@gmail.com> X-Virus-Scanned: amavisd-new at g2ctech.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/81 X-Sequence-Number: 25112 Em Domingo 07 Maio 2006 20:33, Alvaro Herrera escreveu: > > We don't support nested functions at present, but you can create a > separate function and invoke it as you would call any external function. Yeah, I know it and that's how I use some things today, but even so, having nested functions help to write some kinds of code. > This is arguably better, because you may then use inner_function in any > "outer function", not just the current one. It depends. There are cases where it is better -- at least for legibility -- to have nested functions. Having a procedural approach is not always the best algorithm, but, as I said, it solves almost all problems. Thanks, -- Jorge Godoy