Re: BUG #12432: date_trunc returning wrong year and day

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: bquirion(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12432: date_trunc returning wrong year and day
Date: 2015-01-05 20:25:58
Message-ID: 20150105202558.GN1457@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

bquirion(at)gmail(dot)com wrote:

> 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)
>
> I'mn using postgres 8.0.3

8.0.3 was released in 2005. The latest in the 8.0 branch, 8.0.26 was
released in 2010 containing about 600 commits with bug fixes. At the
very least you should update to that version and see if it fixes the
problem you have. In any case you're running a version that has been
out of support for five years now.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-01-05 20:30:31 Re: BUG #12432: date_trunc returning wrong year and day
Previous Message bquirion 2015-01-05 19:17:03 BUG #12432: date_trunc returning wrong year and day