Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y8EDw-0008EN-RY for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Jan 2015 20:26:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y8EDw-0001cE-Cf for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Jan 2015 20:26:00 +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 1Y8EDv-0001c8-PP for pgsql-bugs@postgresql.org; Mon, 05 Jan 2015 20:25:59 +0000 Received: from outmail148102.authsmtp.net ([62.13.148.102]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y8EDr-0007iy-3T for pgsql-bugs@postgresql.org; Mon, 05 Jan 2015 20:25:58 +0000 Received: from mail-c235.authsmtp.com (mail-c235.authsmtp.com [62.13.128.235]) by punt14.authsmtp.com (8.14.2/8.14.2) with ESMTP id t05KPqd3014927; Mon, 5 Jan 2015 20:25:52 GMT Received: from alvin.alvh.no-ip.org (client-186-37-79-218.imovil.entelpcs.cl [186.37.79.218] (may be forged)) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id t05KPir9090436; Mon, 5 Jan 2015 20:25:48 GMT Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 97AE512F4; Mon, 5 Jan 2015 17:25:58 -0300 (CLST) Date: Mon, 5 Jan 2015 17:25:58 -0300 From: Alvaro Herrera To: bquirion@gmail.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12432: date_trunc returning wrong year and day Message-ID: <20150105202558.GN1457@alvh.no-ip.org> References: <20150105191703.11501.36985@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150105191703.11501.36985@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Server-Quench: 09a53429-9519-11e4-b396-002590a15da7 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZcSBoa BzkeAQdJTRslYBtL RB4bawxAL0wMSABN M15eIxoJcUtEGBZ7 UjgUWVRVVU1zWWl3 bgBVZEtcakxQXAJ0 V0FXQFNaCwBgBgMB SFoeV2ISLkdPeHdw YUVkEHJSW0Y0dU8s R01QF2QbbGJhYX0e URVcalFXeQVXfh9H b1l/BXIINTQAKBg1 TUcAFQ0eBgAXAhl6 CkpUdw5JGxRDEjcg SiceBygpFgUfSjku NRonLFFUA1wWNEp6 IFYoQxoRNRNaBgRP dwAA X-Authentic-SMTP: 61633235383639.1023:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 186.37.79.218/587 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Pg-Spam-Score: -2.6 (--) 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 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs