Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xm55j-0004oh-CK for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Nov 2014 18:13:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xm55i-0007Ix-Rp for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Nov 2014 18:13:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xm55M-0006xU-V8 for pgsql-bugs@postgresql.org; Wed, 05 Nov 2014 18:13:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xm55J-0006pQ-2R for pgsql-bugs@postgresql.org; Wed, 05 Nov 2014 18:13:34 +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 sA5IDLS1015536; Wed, 5 Nov 2014 13:13:21 -0500 From: Tom Lane To: Magnus Hagander cc: Bruce Momjian , hunsakerbn@familysearch.org, pgsql-bugs Subject: Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year In-reply-to: References: <20141105175607.26929.23188@wrigleys.postgresql.org> <20141105180225.GB10345@momjian.us> Comments: In-reply-to Magnus Hagander message dated "Wed, 05 Nov 2014 19:05:46 +0100" Date: Wed, 05 Nov 2014 13:13:21 -0500 Message-ID: <15535.1415211201@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) 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 Magnus Hagander writes: > On Wed, Nov 5, 2014 at 7:02 PM, Bruce Momjian wrote: >> Because 1500 % 100 == 0, I think 1500 was not a leap year. > I believe it was a leap year in the Julian calendar, maybe that's > where the difference comes from? Indeed. We won't be changing our code though, because we document that we follow Gregorian calendar rules even before that calendar was instituted (ie, proleptic Gregorian calendar). You could argue for doing that differently, but then what are you going to do for dates before the Julian calendar was instituted? In any case, this behavior appears to be required by the SQL standard, which repeatedly says that datetime values are "constrained according to the Gregorian calendar". 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