Re: Returning multiple result sets

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Returning multiple result sets
Дата
Msg-id 20051120181817.GF32031@svana.org
обсуждение исходный текст
Ответ на Re: Returning multiple result sets  ("Pavel Stehule" <pavel.stehule@hotmail.com>)
Список pgsql-hackers
On Sun, Nov 20, 2005 at 06:05:36PM +0100, Pavel Stehule wrote:
> what is difference between rows with different structures and tables?
> Tables are more logic. But I unlike function which returns setof tables.
> This need data type table. I prefere normal clasic solution.

You're confusing syntax with implementation. Internally the functions
would return a single tuple at a time. But there is no real reason why:

return table (select * from foo);

would not simply loop and return each tuple. We can create syntax as we
feel appropriate if we think it makes thing easier. Thus internally
your two variants would both work and do the same thing. Look at the
SQL language functions. There if you say 'select * from foo' it returns
the whole table without a loop...

Anyway, this discussion isn't really going to go anywhere without some
code. I'll see what I can do.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Returning multiple result sets
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Returning multiple result sets