Re: Proposal: OUT parameters for plpgsql

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal: OUT parameters for plpgsql
Date: 2005-03-21 21:24:44
Message-ID: 873buoelpf.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> The generic thing: you can write OUT and INOUT parameters in CREATE
> FUNCTION. If you do, you can omit the RETURNS clause, in which case the
> result type of the function is implicitly RECORD; or you can specify
> RECORD explicitly; or you can specify SETOF RECORD; or, if there's just
> one OUT/INOUT param, you can specify that param's type or SETOF it.
> (When there is just one, should the default be to return that type
> rather than a one-column RECORD?)

Do other databases not allow you to specify a return value in addition to the
OUT and INOUT parameters?

In other languages that allow multiple return values using pass by reference
you still get one distinguished return value through the regular syntax.
Things like

int foo(int in, int *inout)

I would have expected the return value to be an extra column added to the
record.

Otherwise things get weird if you have an existing plpgsql function used in
plpgsql code that returns a value and want to add an OUT parameter. All of the
sudden you have to convert over the whole call syntax entirely and move the
existing return value into another OUT parameter?

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2005-03-21 21:30:06 Re: Proposal: OUT parameters for plpgsql
Previous Message Steve Crawford 2005-03-21 20:35:22 Re: Excessive growth of pg_attribute and other system tables