Skip site navigation (1) Skip section navigation (2)

Re: generate_series

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thom Brown <thom(at)linux(dot)com>
Cc: YAMAMOTO Takashi <yamt(at)mwd(dot)biglobe(dot)ne(dot)jp>, pgsql-novice(at)postgresql(dot)org
Subject: Re: generate_series
Date: 2011-02-15 15:47:35
Message-ID: 9245.1297784855@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Thom Brown <thom(at)linux(dot)com> writes:
> On 15 February 2011 02:06, YAMAMOTO Takashi <yamt(at)mwd(dot)biglobe(dot)ne(dot)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

In response to

pgsql-novice by date

Next:From: Chetan SuttrawayDate: 2011-02-17 10:08:47
Subject: Re: failed commit question
Previous:From: Thom BrownDate: 2011-02-15 09:55:04
Subject: Re: generate_series

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group