Re: [SQL] generate_series() with TSTZRANGE

2012-09-13 Thread Wolfe Whalen
That's much better, thank you! -- Wolfe Whalen wo...@quios.net On Thu, Sep 13, 2012, at 06:52 AM, Sergey Konoplev wrote: > On Thu, Sep 13, 2012 at 3:53 AM, Wolfe Whalen > wrote: > > SELECT tstzrange((lag(a) OVER()), a, '[)') > > FROM generate_series('2012-09-16 12:00:00'::timestamp, '2012-

Re: [SQL] generate_series() with TSTZRANGE

2012-09-13 Thread Sergey Konoplev
On Thu, Sep 13, 2012 at 3:53 AM, Wolfe Whalen wrote: > SELECT tstzrange((lag(a) OVER()), a, '[)') > FROM generate_series('2012-09-16 12:00:00'::timestamp, '2012-09-17 > 12:00:00', '1 hour') > AS a OFFSET 1; What about this form? select tstzrange(a, a + '1 hour'::interval, '[)') from generate_ser

[SQL] generate_series() with TSTZRANGE

2012-09-12 Thread Wolfe Whalen
Hi everyone! I'm new around here, so please forgive me if this is a bit trivial. It seems that generate_series() won't generate time stamp ranges. I googled around and didn't see anything handy, so I wrote this out and thought I'd share and see if perhaps there was a better way to do it: SELECT