Re: generate_series - Mailing list pgsql-novice

From Tom Lane
Subject Re: generate_series
Date
Msg-id 9245.1297784855@sss.pgh.pa.us
Whole thread Raw
In response to Re: generate_series  (Thom Brown <thom@linux.com>)
List pgsql-novice
Thom Brown <thom@linux.com> writes:
> On 15 February 2011 02:06, YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp> wrote:
>> the following behaviour of multiple generate_series in a select seems
>> a little counter-intuitive to me.

> The output of such queries will keep producing output until all
> generate_series functions are at their end simultaneously.

Right, so the actual number of result rows is the least common multiple
of their periods.  This is undocumented because nobody is very happy
with it and we don't want users relying on it.  Eventually we may
deprecate set-returning functions in SELECT's targetlist altogether,
but that won't happen until there's an adequate replacement (possibly
LATERAL).  In the meantime it's best to avoid having more than one per
SELECT.

            regards, tom lane

pgsql-novice by date:

Previous
From: Thom Brown
Date:
Subject: Re: generate_series
Next
From: Chetan Suttraway
Date:
Subject: Re: failed commit question