Hackers,
I'm curious about behavior such as this:
bric=# select generate_series('2011-05-31'::timestamp ,
'2012-04-01'::timestamp, '1 month');
generate_series
-
2011-05-31 00:00:00
2011-06-30 00:00:00
2011-07-30 00:00:00
2011-08-30 00:00:00
2011-09-30 00:00:00
On 06/27/2011 10:49 AM, David E. Wheeler wrote:
Hackers,
I'm curious about behavior such as this:
bric=# select generate_series('2011-05-31'::timestamp ,
'2012-04-01'::timestamp, '1 month');
generate_series
-
2011-05-31 00:00:00
2011-06-30 00:00:00
2011-07-30
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
David E. Wheeler da...@kineticode.com wrote:
generate_series
-
2011-05-31 00:00:00
2011-06-30 00:00:00
2011-07-31 00:00:00
2011-08-31 00:00:00
2011-09-30 00:00:00
2011-10-31 00:00:00
2011-11-30 00:00:00
2011-12-31 00:00:00
2012-01-31 00:00:00
On Jun 27, 2011, at 11:03 AM, Kevin Grittner wrote:
It is precisely to support such fancy things that some products
support a more abstract date type which allows 31 days in any month,
and then normalizes to real dates as needed. The PostgreSQL
developer community has generally not been
On 06/27/2011 10:56 AM, David E. Wheeler wrote:
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
On Jun 27, 2011, at 11:36 AM, Steve Crawford wrote:
The query is marginally trickier. But the better calendaring apps give a
variety of options when selecting repeat: A user who selects June 30, 2011
and wants a monthly repeat might want:
30th of every month - skip months without a 30th
On Mon, Jun 27, 2011 at 1:38 PM, David E. Wheeler da...@kineticode.comwrote:
Yeah, which is why I said it was subject to interpretation. Of course
there's no way to tell generate_series() which to use, which is what I
figured.
generate_series() is doing exactly what it was designed to do,
Yeah, which is why I said it was subject to interpretation. Of course there's
no way to tell generate_series() which to use, which is what I figured.
Fortunately PostgreSQL uses the same interpretation for '1 month' when
used in generate_series that it does everywhere else - to do otherwise
On Mon, Jun 27, 2011 at 1:49 PM, David E. Wheeler da...@kineticode.com wrote:
Hackers,
I'm curious about behavior such as this:
bric=# select generate_series('2011-05-31'::timestamp ,
'2012-04-01'::timestamp, '1 month');
generate_series
-
2011-05-31 00:00:00
On Mon, Jun 27, 2011 at 2:36 PM, Steve Crawford
scrawf...@pinpointresearch.com wrote:
On 06/27/2011 10:56 AM, David E. Wheeler wrote:
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.
On Jun 27, 2011, at 12:36 PM, Christopher Browne wrote:
I wrote something on this on pgsql-general about 5 years ago that
still seems pretty relevant.
http://archives.postgresql.org/pgsql-general/2006-02/msg00159.php
iwantsandy.com (now defunct) originally had a solution like this. However
12 matches
Mail list logo