Re: Returning sets from functions?

Поиск
Список
Период
Сортировка
От mig@utdt.edu
Тема Re: Returning sets from functions?
Дата
Msg-id 200004231502.MAA05163@ant.utdt
обсуждение исходный текст
Ответ на Returning sets from functions?  (mig@utdt.edu)
Ответы Re: Re: Returning sets from functions?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Sorry, I forgot part of my question in the previous message: How do you return a "setof" value from a PG/Tcl procedure?
Returninga list does not seem to work ...
 

### PREVIOUS MESSAGE WAS ...

Consider   create function followers(text) returns setof text as          'select id from ids where id > $1 '
language'sql';
 

The function seems to work OK:   select followers('h');
does return all indexes after the index 'h'.

On the other hand,   select * from ids where id in (select followers('h'));
produces the message ERROR:  An operand to the '=' operator returns a set of text,       but '=' takes single values,
notsets.
 

Apparently the phrase   select followers('h');
returns a set with members which are 'setof text'. psql has no trouble
displaying all rows, but the parser does ...

So, my question is: can I produce a set in a function so that it
mimicks perfectly the return set of a select query?

I am using PG 6.5.3; is this already solved in the 7.0 beta?

Thanks

Miguel Sofer



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: TOAST (was: BLOB)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: Returning sets from functions?