pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Owen Jacobson <ojacobson@osl.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: OUT parameter
Date: Wed, 22 Mar 2006 21:47:31 -0500
Message-ID: <27322.1143082051@sss.pgh.pa.us> (raw)
In-Reply-To: <144D12D7DD4EC04F99241498BB4EEDCC25EAD1@nelson.osl.com>
References: <144D12D7DD4EC04F99241498BB4EEDCC25EAD1@nelson.osl.com>

> 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" <ojacobson@osl.com> 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



view thread (5+ messages)  latest in thread

Message-ID: <27322.1143082051@sss.pgh.pa.us>
Permalink:  ../27322.1143082051@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27322.1143082051@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ojacobson@osl.com
  Subject: Re: OUT parameter
  In-Reply-To: <27322.1143082051@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox