Passing result of multirow subquery to C function

Поиск
Список
Период
Сортировка
During the holidays I've taken on to looking at writing a postgres C
extension/function. What I've done so far is more or less the article
series by Ron Peterson (http://linuxgazette.net/142/peterson.html).

What I'm having issues figuring out is how to pass the results of a
subquery to a function (if at all possible?):

SELECT hello((SELECT name FROM names));

Where name is of type TEXT. And results from calling the function is:

hello
------------
Hello, Benny
Hello, Kenny

And what the function does is to only prepend "Hello, " to the string.

My naive attempt errors with:
ERROR: more than one row returned by a subquery used as an expression

What should I be looking at?


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

Предыдущее
От: Tanstaafl
Дата:
Сообщение: Re: Reliably backing up a live database
Следующее
От: David Johnston
Дата:
Сообщение: Re: Passing result of multirow subquery to C function