Re: generate_series() Interpretation - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: generate_series() Interpretation
Date
Msg-id BA3B2597-4F1C-4720-B252-BB39AFD76FA9@kineticode.com
Whole thread Raw
In response to Re: generate_series() Interpretation  (Steve Crawford <scrawford@pinpointresearch.com>)
Responses Re: generate_series() Interpretation
List pgsql-hackers
On Jun 27, 2011, at 10:54 AM, Steve Crawford wrote:

> That's just how intervals that represent varying periods of time work. You would need to write your own. But a series
ofend-of-month dates is pretty easy: 
> select generate_series('2011-06-01'::timestamp , '2012-04-01'::timestamp, '1 month') - '1 day'::interval;

Yeah, but it's trickier if you have a calendaring app and don't know that date a user has chosen for a monthly
recurringevent. They might have selected June 30, in which case only February would ever need to be different than the
default.

Best,

David



pgsql-hackers by date:

Previous
From: Steve Crawford
Date:
Subject: Re: generate_series() Interpretation
Next
From: Bruce Momjian
Date:
Subject: Re: pg_upgrade defaulting to port 25432