Re: BUG #14294: Problem in generate series between dates

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pablopumarino(at)gmail(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14294: Problem in generate series between dates
Date: 2016-08-24 19:40:45
Message-ID: 87oa4i9d8w.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

>> When I use postgres function:
>> SELECT generate_series('2016-08-01', '2016-08-31', '1
>> day'::interval)::date
>> it gives me the corresponding list of days but for some reason it misses the
>> day 2016-08-31.

Tom> In addition to Andrew's questions:

Tom> * What time zone are you using?

I discovered that this is reproducible in America/Santiago

Tom> * In that zone, is there a DST rule change near 2016-08-31?

The DST change seems to be at midnight local on 2016-08-14 (who puts
their DST changes at midnight? that breaks things here)

This _looks_ wrong:

set timezone = 'America/Santiago';
select timestamptz '2016-08-13', timestamptz '2016-08-13' + interval '1 day';
timestamptz | ?column?
------------------------+------------------------
2016-08-13 00:00:00-04 | 2016-08-14 01:00:00-03
(1 row)

but I guess it's inevitable, since 2016-08-14 00:00:00 doesn't exist in
the local time, so there's no other possible result to return.

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Rick Otten 2016-08-24 20:08:09 Re: BUG #14290: materialized view refresh doesn't use temp_tablespace
Previous Message Tom Lane 2016-08-24 19:13:01 Re: BUG #14294: Problem in generate series between dates