Re: [HACKERS] generate_series from now to infinity...

2009-05-17 Thread Tom Lane
hubert depesz lubaczewski writes: > why is it not limiting generate_series in the second example? nodeFunctionscan.c sucks the whole SRF output into a tuplestore before returning any of it. In principle you could do something different for a value-per-call SRF, but it would require a second whol

Re: [HACKERS] generate_series from now to infinity...

2009-05-17 Thread Dickson S. Guedes
Em Dom, 2009-05-17 às 19:22 +0200, hubert depesz lubaczewski escreveu: > it doesn't for this query: > > SELECT i from generate_series(now(), CAST('infinity'::date AS > timestamp), interval '1 hour') as x (i) limit 3; > > which (as far as i understand it) should be the same. > > why is it not lim

Re: [HACKERS] generate_series from now to infinity...

2009-05-17 Thread hubert depesz lubaczewski
On Sun, May 17, 2009 at 01:38:35PM -0300, Dickson S. Guedes wrote: > I suggested him to use LIMIT. interesting. I just tested (on beta1), that while limit works in this query: SELECT generate_series(now(), CAST('infinity'::date AS timestamp), interval '1 hour') limit 3; i.e. it returns 3 rows in

Re: [HACKERS] generate_series from now to infinity...

2009-05-17 Thread Dickson S. Guedes
Em Sáb, 2009-05-16 às 23:40 -0400, Tom Lane escreveu: > "Dickson S. Guedes" 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?

Re: [HACKERS] generate_series from now to infinity...

2009-05-17 Thread Robert Haas
On May 16, 2009, at 11:58 PM, Brendan Jurd wrote: On Sun, May 17, 2009 at 1:40 PM, Tom Lane wrote: "Dickson S. Guedes" 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 expe

Re: [HACKERS] generate_series from now to infinity...

2009-05-16 Thread Brendan Jurd
On Sun, May 17, 2009 at 1:40 PM, Tom Lane wrote: > "Dickson S. Guedes" 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? It appears that any genera

Re: [HACKERS] generate_series from now to infinity...

2009-05-16 Thread Tom Lane
"Dickson S. Guedes" 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? Actually, I believe it will fail eventually when the repeated additions overflow ...

[HACKERS] generate_series from now to infinity...

2009-05-16 Thread Dickson S. Guedes
Hi all Is a simple "SELECT generate_series(now(), CAST('infinity'::date AS timestamp), interval '1 hour');" working forever, an expected behavior? regards... -- Dickson S. Guedes - mail/xmpp: gue...@guedesoft.net - skype: guediz http://guedesoft.net - http://www.postgresql.org.br -- Sent via p