Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 30A9B6330BD for ; Sat, 27 Mar 2010 17:22:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 89842-05 for ; Sat, 27 Mar 2010 20:22:17 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx3.wp.pl (mx3.wp.pl [212.77.101.7]) by mail.postgresql.org (Postfix) with ESMTP id 4E2CB632B70 for ; Sat, 27 Mar 2010 17:22:21 -0300 (ADT) Received: (wp-smtpd smtp.wp.pl 3873 invoked from network); 27 Mar 2010 21:22:19 +0100 Received: from aayv74.neoplus.adsl.tpnet.pl (HELO [127.0.0.1]) (ipluta@[83.6.133.74]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 27 Mar 2010 21:22:19 +0100 Message-ID: <4BAE68FA.8000803@wp.pl> Date: Sat, 27 Mar 2010 21:22:18 +0100 From: Ireneusz Pluta User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Jorge Godoy CC: Sergey Konoplev , pgsql-sql@postgresql.org Subject: Re: Week to date function References: <4BAB2C15.8090406@wp.pl> <4BAC9107.5070701@wp.pl> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [QVOU] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.432 tagged_above=-10 required=5 tests=AWL=-0.433, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201003/208 X-Sequence-Number: 33915 Jorge Godoy pisze: > Are you sure? > > http://en.wikipedia.org/wiki/ISO_8601 snip > > As Jan 1st, 2010 happened on a Friday, it was on week 53 of 2009. you are right, thanks for pointing that out. I didn't check the opposite way like this: select date_part('week', '2010-01-01'::date); date_part ----------- 53 I need to recheck my code.