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 44A329DCD5A for ; Wed, 22 Mar 2006 22:47: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 12016-02 for ; Wed, 22 Mar 2006 22:47:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 16CFC9DCA8D for ; Wed, 22 Mar 2006 22:47:33 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k2N2lWGs027323; Wed, 22 Mar 2006 21:47:32 -0500 (EST) To: "Owen Jacobson" cc: pgsql-sql@postgresql.org Subject: Re: OUT parameter In-reply-to: <144D12D7DD4EC04F99241498BB4EEDCC25EAD1@nelson.osl.com> References: <144D12D7DD4EC04F99241498BB4EEDCC25EAD1@nelson.osl.com> Comments: In-reply-to "Owen Jacobson" message dated "Wed, 22 Mar 2006 14:39:13 -0800" Date: Wed, 22 Mar 2006 21:47:31 -0500 Message-ID: <27322.1143082051@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.114 required=5 tests=[AWL=0.114] X-Spam-Score: 0.114 X-Spam-Level: X-Archive-Number: 200603/374 X-Sequence-Number: 24720 > Daniel Caune wrote: >> Is there any suggestion against using OUT parameter for local >> calculation such as using a local variable? In plpgsql (at least in the current implementation) an OUT parameter is pretty much just a local variable, and so there's no efficiency argument against using it as a temporary. Whether you consider this good style is a matter of opinion. "Owen Jacobson" writes: > I'd say there's no problem with this, PROVIDED you can ensure you'll > never abort before completing the computation. Not really an issue in Postgres: we do not support pass-by-reference parameters and are unlikely to start doing so. There isn't any way that you can affect locals of a calling procedure before you return. regards, tom lane