Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aGTGx-00082M-69 for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Jan 2016 15:11:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aGTGw-0005Q7-Al for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Jan 2016 15:11:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aGTGK-0004j1-06 for pgsql-bugs@postgresql.org; Tue, 05 Jan 2016 15:11:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aGTGC-0004re-OV for pgsql-bugs@postgresql.org; Tue, 05 Jan 2016 15:11:03 +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 u05FAr01016669; Tue, 5 Jan 2016 10:10:54 -0500 From: Tom Lane To: "Shulgin, Oleksandr" cc: kees.westerlaken@valuecare.nl, Pg Bugs Subject: Re: BUG #13845: Incorrect week number In-reply-to: References: <20160105105924.1114.70550@wrigleys.postgresql.org> Comments: In-reply-to "Shulgin, Oleksandr" message dated "Tue, 05 Jan 2016 12:11:54 +0100" Date: Tue, 05 Jan 2016 10:10:53 -0500 Message-ID: <16668.1452006653@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 "Shulgin, Oleksandr" writes: > Scratch that, I'm confused about YYYY format, has to use IYYY instead. Exactly. There's no bug here, it's just that you have to use IYYY together with IW if you want sensible results. Per the fine manual: Caution: While to_date will reject a mixture of Gregorian and ISO week-numbering date fields, to_char will not, since output format specifications like YYYY-MM-DD (IYYY-IDDD) can be useful. But avoid writing something like IYYY-MM-DD; that would yield surprising results near the start of the year. 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