Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xm4yK-0004X4-2w for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Nov 2014 18:06:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xm4yJ-0003Dg-HR for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Nov 2014 18:06:19 +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 1Xm4yI-0003B6-33 for pgsql-bugs@postgresql.org; Wed, 05 Nov 2014 18:06:18 +0000 Received: from mail6.gmhwh.org ([216.49.179.96]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Xm4yE-0006if-9y for pgsql-bugs@postgresql.org; Wed, 05 Nov 2014 18:06:16 +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=NSmvGpRhGOJDiaCXKxM4UMlzekTSdrxiCpeOZlNmQ3c=; b=fffYm0SeYnekA6B3GwH7yYjHV9ScrS1P3VSUva4z4slbjU3q3bc1juKVF0XgP7S+nsFc F5ByenCSNgPe3J5uApo/QXdwvOuCaKusiabFUsk9p5oFxGdkn5ryujJSZvSjiUJPUTcc EpI0Uu28fWHH9fyye2/zVA7lu3XB9eZ7aA260bAkDANvg6SAm7gvLs9MCsNdK9g6ipJZ dLqJvaezbvySibAFHzSw/CABw70qQvawlynBX0x6BNOp6KwwRQF0F4CNN8nTugzn3946 imzahPZ6eluJG/gr8+NbkjrR/Llq/u17FFlL8zqmfE9cVuB4PTWOkcPT/3yPGkDRwLK6 qQ== Received: from W12118.ldschurch.org ([10.97.40.118]) by mail6.gmhwh.org (8.14.5/8.14.5) with ESMTP id sA5I64AS015584 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 5 Nov 2014 11:06:04 -0700 Received: from gr8.dev (10.98.250.245) by mail.ldschurch.org (10.97.40.118) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 5 Nov 2014 11:06:04 -0700 Date: Wed, 5 Nov 2014 11:06:03 -0700 From: Bruce Hunsaker To: Bruce Momjian CC: , Subject: Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year Message-ID: <20141105180603.GA15519@gr8.dev> Reply-To: References: <20141105175607.26929.23188@wrigleys.postgresql.org> <20141105180225.GB10345@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20141105180225.GB10345@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-05_08:2014-11-05,2014-11-05,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-1411050166 X-Pg-Spam-Score: -1.4 (-) 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 05 Nov 14 13 02, Bruce Momjian wrote: > On Wed, Nov 5, 2014 at 05:56:07PM +0000, hunsakerbn@familysearch.org wrote: > > The following bug has been logged on the website: > > > > Bug reference: 11883 > > Logged by: Bruce Hunsaker > > Email address: hunsakerbn@familysearch.org > > PostgreSQL version: 9.3.5 > > Operating system: Linux > > Description: > > > > Entering historical dates we found we could not enter a date of '1500-02-29' > > Even though 1500 is documented to be a leap year. Tested with date and > > timestamp column types. > > > > To reproduce: > > psql> create table date_test (mydate date); > > CREATE TABLE > > psql> insert into date_test values ('1500-02-29'); > > ERROR: date/time field value out of range: "1500-02-29" > > LINE 1: insert into date_test values ('1500-02-29'); > > > > psql> insert into date_test values ('1500-02-28'); > > INSERT 0 1; > > > > So, Feb 29, is not allowed but Feb 28 is. > > Uh, what makes you think 1500 was a leap year? This is the canonical > way to calculate which years are leap years: > > #define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) > > Because 1500 % 100 == 0, I think 1500 was not a leap year. Well, I believe that rule started at 1600. Wikipedia says it's a leap year. As do some other sources I checked. -- 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