Re: Proposal: OUT parameters for plpgsql

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Proposal: OUT parameters for plpgsql
Дата
Msg-id 873buoelpf.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Proposal: OUT parameters for plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Proposal: OUT parameters for plpgsql
Re: Proposal: OUT parameters for plpgsql
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Proposal: OUT parameters for plpgsql
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Proposal: OUT parameters for plpgsql