Re: functions are returns columns

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: functions are returns columns
Дата
Msg-id 19335.1194723995@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: functions are returns columns  (Gregory Stark <stark@enterprisedb.com>)
Ответы Re: functions are returns columns
Список pgsql-sql
Gregory Stark <stark@enterprisedb.com> writes:
> You're almost there:

> CREATE FUNCTION getfoo (IN int, OUT int, OUT int) returns setof record(int,int) AS $$
>   SELECT fooid, foosubid FROM foo WHERE fooid = $1;
> $$ LANGUAGE SQL;

Not quite --- it's just "returns setof record".  The output column types
are defined by the OUT parameters.  The only reason you need the returns
clause is to have a place to stick the "setof" specification ...
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: functions are returns columns
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: functions are returns columns