From: Tom Lane <tgl@sss.pgh.pa.us>
To: bquirion@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #12432: date_trunc returning wrong year and day
Date: Mon, 05 Jan 2015 15:30:31 -0500
Message-ID: <4787.1420489831@sss.pgh.pa.us> (raw)
In-Reply-To: <20150105191703.11501.36985@wrigleys.postgresql.org>
References: <20150105191703.11501.36985@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
bquirion@gmail.com writes:
> foodb=> select date_trunc('week', now() - interval '1 week');
> date_trunc
> ------------------------
> 2013-12-30 00:00:00-08
> (1 row)
> foodb=> select date_trunc('week', now() - interval '2 week');
> date_trunc
> ------------------------
> 2014-12-22 00:00:00-08
> (1 row)
Works for me ...
> I'mn using postgres 8.0.3
A quick look in the commit logs finds an 8.0.4 fix that seems likely
to be the same thing:
Author: Bruce Momjian <bruce@momjian.us>
Branch: REL8_0_STABLE Release: REL8_0_4 [0a056c371] 2005-07-04 14:12:45 +0000
Fix date_trunct for December dates that are in the next year, e.g.:
SELECT date_trunc('week', '2002-12-31'::date);
Backpatch to 8.0.X.
Per report from Nick Johnson.
You do realize that (1) 8.0.x has been out of support for more than
four years, and (2) the last release in that series was 8.0.26?
You will not get a lot of traction from filing bug reports against
ten-year-old releases.
regards, tom lane
--
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: tgl@sss.pgh.pa.us, bquirion@gmail.com
Subject: Re: BUG #12432: date_trunc returning wrong year and day
In-Reply-To: <4787.1420489831@sss.pgh.pa.us>
References: <20150105191703.11501.36985@wrigleys.postgresql.org> <4787.1420489831@sss.pgh.pa.us>
* 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