Re: plpgsql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: plpgsql
Дата
Msg-id 19870.1108199576@sss.pgh.pa.us
обсуждение исходный текст
Ответ на plpgsql  (dim <dim45@gmx.net>)
Ответы Re: plpgsql  (dim <dim45@gmx.net>)
Список pgsql-novice
dim <dim45@gmx.net> writes:
> The error is "Function returning row cannot return null
> value". Is the only solution to this problem to declare function get_a
> to return "SET OF a" ?

Might not be the only solution, but IMHO it's the correct solution.
Your underlying SELECT returns either a row, or no row (or possibly
more than one row?) so the function should too.

> Am I missing anything or is
> record assignment not possible in plpgsql?

Your example works fine for me in PG 8.0.  There were some improvements
in this area since 7.*, though I'm not sure offhand whether they were
material to this particular case.

            regards, tom lane

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

Предыдущее
От: dim
Дата:
Сообщение: plpgsql
Следующее
От: dim
Дата:
Сообщение: Re: plpgsql