Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XmO4h-0002nc-BU for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Nov 2014 14:30:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XmO4g-0002zu-J3 for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Nov 2014 14:30:10 +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 1XmO4f-0002yr-24 for pgsql-bugs@postgresql.org; Thu, 06 Nov 2014 14:30:09 +0000 Received: from mail7.ldschurch.org ([216.49.178.97] helo=mail7.gmhwh.org) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XmO4a-00045T-41 for pgsql-bugs@postgresql.org; Thu, 06 Nov 2014 14:30:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ldschurch.org; h=date : from : to : cc : subject : message-id : reply-to : references : mime-version : content-type : in-reply-to; s=nov2012; bh=8z583aTEDBmKGKWQSpDK/2S5//Ir/9Tz9OhyIBnTl9s=; b=KPY+p/cC9AFNotmElbDDxjrLboaAf8by5mZMe+RZy1a+FDD3XiteXCbDvSg+3CDB/cgB mRCv0EUXyep6ZbGc0nfPfC7f3BU6vhPQfhMJL3n5BTsKvSjEnktnF3ifZOlrVWRY7JoO 8NzTFdZubHPnbESno72yPIH9BzMpJttpp4ps/X1gaZ6nAQDXxdHuaH6IKbrL7C8V77xC VPelUBUdez+tY9N3M6tCfLcheVK/EPXNoNXMFBECYkqsKgArw6hJhbhUGb3zGWHMpffk OzpQ5HO9u6NFkT/ahAb4bIrrNkiFnssuOn+iaMviyil7RnuZtKb5upQVOW2fqSSlw9D9 fg== Received: from W12119.ldschurch.org ([10.97.50.119]) by mail7.gmhwh.org (8.14.5/8.14.5) with ESMTP id sA6ETorA030690 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 6 Nov 2014 07:29:50 -0700 Received: from gr8.dev (10.98.250.245) by mail.ldschurch.org (10.97.50.119) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 6 Nov 2014 07:29:50 -0700 Date: Thu, 6 Nov 2014 07:29:49 -0700 From: Bruce Hunsaker To: Bruce Momjian CC: Tom Lane , Magnus Hagander , , pgsql-bugs Subject: Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year Message-ID: <20141106142949.GA4487@gr8.dev> Reply-To: References: <20141105175607.26929.23188@wrigleys.postgresql.org> <20141105180225.GB10345@momjian.us> <15535.1415211201@sss.pgh.pa.us> <20141106073451.GA4253@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20141106073451.GA4253@momjian.us> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [10.98.250.245] X-Disclaimer: True X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52, 1.0.28, 0.0.0000 definitions=2014-11-06_05:2014-11-06,2014-11-06,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1411060113 X-Pg-Spam-Score: -2.0 (--) 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 On 06 Nov 14 02 34, Bruce Momjian wrote: > On Wed, Nov 5, 2014 at 01:13:21PM -0500, Tom Lane wrote: > > 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". > > I have applied the attached C comment to document why we use the > Gregorian calendar for pre-1582 years. Thanks everyone for the response. I guess the bottom line for us is that if we want to store dates before 1582, we may not want to use date or timestamp columns for that data, particularly if the dates are from a Julian calendar. -- Bruce Hunsaker NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs