Re: [SQL] Table returning functions

2010-09-20 Thread Jann Röder
True, but it still allowed me to write queries that I do not know how to express otherwise. Am 20.09.10 01:58, schrieb Tom Lane: > =?UTF-8?B?SmFubiBSw7ZkZXI=?= writes: >> Ok I now know that it really seems to do what I expected. But I still >> wonder what it does if I use two functions f() and g(

Re: [SQL] Table returning functions

2010-09-19 Thread Tom Lane
=?UTF-8?B?SmFubiBSw7ZkZXI=?= writes: > Ok I now know that it really seems to do what I expected. But I still > wonder what it does if I use two functions f() and g() that return a > different number of rows. You get the least common multiple of their periods. It's ugly, and the lack of any very

Re: [SQL] Table returning functions

2010-09-19 Thread Jann Röder
Ok I now know that it really seems to do what I expected. But I still wonder what it does if I use two functions f() and g() that return a different number of rows. I'm guessing a query such as SELECT id, (f(id)).a, (g(id)).b when f returns 3 rows and g returns two row would yield something like

[SQL] Table returning functions

2010-09-08 Thread Jann Röder
Hi, I have a question which does not seem to be covered in the documentation: I have a function f(i) that returns a table with three columns (a, b, c). In the documentation (http://www.postgresql.org/docs/8.4/interactive/xfunc-sql.html#XFUNC-SQL-FUNCTIONS-RETURNING-SET) it says that (even though d