Re: generate_series() Interpretation

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: generate_series() Interpretation
Date: 2011-06-27 17:56:37
Message-ID: BA3B2597-4F1C-4720-B252-BB39AFD76FA9@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 of end-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 recurring event. They might have selected June 30, in which case only February would ever need to be different than the default.

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-06-27 17:59:07 Re: pg_upgrade defaulting to port 25432
Previous Message Steve Crawford 2011-06-27 17:54:01 Re: generate_series() Interpretation