From: John R Pierce <pierce@hogranch.com>
To: pablopumarino@gmail.com
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #14294: Problem in generate series between dates
Date: Wed, 24 Aug 2016 11:59:16 -0700
Message-ID: <56e85f55-6de8-3de6-65e6-12eca07074aa@hogranch.com> (raw)
In-Reply-To: <20160824182920.15681.52285@wrigleys.postgresql.org>
References: <20160824182920.15681.52285@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 8/24/2016 11:29 AM, pablopumarino@gmail.com wrote:
> 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.
> -I've tried this with other months and it works correctly, also if I use it
> for the same dates but on 2015 it works fine.
> -This started failing after we upgraded our system to the version 9.5.4,
> I've tryed it in an older release that we had installed and it worked.
I would write that as...
select generate_series(timestamp '2016-08-01', timestamp '2016-08-31',
interval '1 day')::date;
the notation type 'string value' is a native constant in that type,
while the notation 'string value'::type generates a text constant and
typecasts it.
--
john r pierce, recycling bits in santa cruz
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: pierce@hogranch.com, pablopumarino@gmail.com
Subject: Re: BUG #14294: Problem in generate series between dates
In-Reply-To: <56e85f55-6de8-3de6-65e6-12eca07074aa@hogranch.com>
References: <20160824182920.15681.52285@wrigleys.postgresql.org> <56e85f55-6de8-3de6-65e6-12eca07074aa@hogranch.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox