Re: Playing with set returning functions in SELECT list - behaviour intended?

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, pgsql-general(at)postgresql(dot)org
Subject: Re: Playing with set returning functions in SELECT list - behaviour intended?
Date: 2009-06-17 14:48:33
Message-ID: 20090617144832.GM860@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 16, 2009 at 10:06:54AM -0400, Tom Lane wrote:
> "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at> writes:
> > So it looks like the number of result rows is the least common
> > multiple of the cardinalities of all columns in the select list.
>
> It's always been that way. The lack of any obviously-sane way to
> handle multiple SRFs in a targetlist is exactly why the feature is
> looked on with disfavor.

I must be missing something obvious. Isn't the nested loop thing that
happens with generate_series() pretty sane?

SELECT generate_series(1,2) AS i, generate_series(1,3) AS j;
i | j
---+---
1 | 1
2 | 2
1 | 3
2 | 1
1 | 2
2 | 3
(6 rows)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Todd A. Cook 2009-06-17 14:50:13 FYI: Load times for a largish DB in 8.2 vs. 8.3 vs. 8.4
Previous Message David Fetter 2009-06-17 14:42:16 Re: Naming functions with reserved words