Re: Add generate_series(date,date) and generate_series(date,date,integer)

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add generate_series(date,date) and generate_series(date,date,integer)
Date: 2016-01-26 18:26:26
Message-ID: 20160126182626.GA570111@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs wrote:
> On 25 January 2016 at 09:55, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
> wrote:
>
>
> > Imagine for example a script that in some rare cases passes happens to
> > pass infinity into generate_series() - in that case I'd much rather error
> > out than wait till the end of the universe.
> >
> > So +1 from me to checking for infinity.
>
> +1
>
> ERROR infinite result sets are not supported, yet

In the future we may get lazy evaluation of functions. When and if that
happens we may want to remove this limitation so that you can get a
streaming result producing timestamp values continuously.

(I don't necessarily think you'd use generate_series in such cases.
Maybe you'd want clock_timestamp to generate the present value at each
call, for example. But there may be uses for synthetic values as well.)

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2016-01-26 18:37:51 Re: remove wal_level archive
Previous Message Euler Taveira 2016-01-26 18:21:20 Re: Add generate_series(date,date) and generate_series(date,date,integer)