Re: Proposal: OUT parameters for plpgsql - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Proposal: OUT parameters for plpgsql
Date
Msg-id 873buoelpf.fsf@stark.xeocode.com
Whole thread Raw
In response to Proposal: OUT parameters for plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proposal: OUT parameters for plpgsql
Re: Proposal: OUT parameters for plpgsql
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Proposal: OUT parameters for plpgsql
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Proposal: OUT parameters for plpgsql