Re: generate_series from now to infinity... - Mailing list pgsql-hackers

From Dickson S. Guedes
Subject Re: generate_series from now to infinity...
Date
Msg-id 1242578315.18964.31.camel@guedes-laptop
Whole thread Raw
In response to Re: generate_series from now to infinity...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: generate_series from now to infinity...  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-hackers
Em Sáb, 2009-05-16 às 23:40 -0400, Tom Lane escreveu:
> "Dickson S. Guedes" <listas@guedesoft.net> writes:
> > Is a simple "SELECT generate_series(now(), CAST('infinity'::date AS
> > timestamp), interval '1 hour');" working forever, an expected
> > behavior?
>
> Uh, what were you expecting it to do?

Perhaps, a HINT?

> Actually, I believe it will fail eventually when the repeated additions
> overflow ... in 294277 AD.  So you've got about 2 billion timestamp
> additions to wait through.

A customer are porting his application to 8.4, and are using a query
like that. Someone unintentionally included a "infinity" date and that
query have been running until they see the test server memory at 99% and
cpu at 100%.

I suggested him to use LIMIT.

[]s
--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://guedesoft.net - http://www.postgresql.org.br

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: generate_series from now to infinity...
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: generate_series from now to infinity...