Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y8EIU-0008RQ-Gj for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Jan 2015 20:30:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y8EIT-0002Oe-OX for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Jan 2015 20:30:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y8EIS-0002OX-Qy for pgsql-bugs@postgresql.org; Mon, 05 Jan 2015 20:30:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y8EIN-0007ob-Cz for pgsql-bugs@postgresql.org; Mon, 05 Jan 2015 20:30:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t05KUV6S004788; Mon, 5 Jan 2015 15:30:31 -0500 From: Tom Lane To: bquirion@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12432: date_trunc returning wrong year and day In-reply-to: <20150105191703.11501.36985@wrigleys.postgresql.org> References: <20150105191703.11501.36985@wrigleys.postgresql.org> Comments: In-reply-to bquirion@gmail.com message dated "Mon, 05 Jan 2015 19:17:03 +0000" Date: Mon, 05 Jan 2015 15:30:31 -0500 Message-ID: <4787.1420489831@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 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