Re: Returning multiple result sets - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Returning multiple result sets
Date
Msg-id 20051120181817.GF32031@svana.org
Whole thread Raw
In response to Re: Returning multiple result sets  ("Pavel Stehule" <pavel.stehule@hotmail.com>)
List 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 by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Returning multiple result sets
Next
From: "Pavel Stehule"
Date:
Subject: Re: Returning multiple result sets