Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XmlpP-00065I-AC for pgsql-bugs@arkaria.postgresql.org; Fri, 07 Nov 2014 15:51:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XmlpO-0000wt-PM for pgsql-bugs@arkaria.postgresql.org; Fri, 07 Nov 2014 15:51: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 1XmlpN-0000uZ-HY for pgsql-bugs@postgresql.org; Fri, 07 Nov 2014 15:51:57 +0000 Received: from mail2.gmhwh.org ([216.49.179.92]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XmlpK-0004aj-GX for pgsql-bugs@postgresql.org; Fri, 07 Nov 2014 15:51:55 +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=YDqDB5zd4InWcSmlJv607G76rL2PUuRNybwbTP7YfgU=; b=fQHksqZHE0C7chcNuIztuKN5YrlRJ7PdxLeOJcG8RWWFsPqUWoMbmS8I365YKC35YLpB 8oHUfu0uazmGJs3qvwSx05y61cjkIBhauQ8Y/ZHvU4NciMU0Dyz2XGB49WH/f1RZUhc0 ZbuneElTcSJUAADQ0tMCabfRgyXdXFBoi2pKyoclMrK3azw6cJgjtdhqJTcgSCsIws2w TM+PNeAOqZoRDj6D2RBHHhro/Y36xY1RyzS3APWYlnOH6t9CMtNHRJqV8vvNuUla3NRi qJgw/HZp/ebjE0OQAqJsR2jhg/htQ1u69VKOFUuClFd1QhhQx13fTa6T6t9uPNsrg/Us Uw== Received: from W12117.ldschurch.org (W12117.ldschurch.org [10.97.40.117]) by mail2.gmhwh.org (8.14.5/8.14.5) with ESMTP id sA7Fpj9e023814 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 7 Nov 2014 08:51:45 -0700 Received: from gr8.dev (10.98.250.245) by mail.ldschurch.org (10.97.40.117) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 7 Nov 2014 08:51:45 -0700 Date: Fri, 7 Nov 2014 08:51:44 -0700 From: Bruce Hunsaker To: Tom Lane CC: , Bruce Momjian , Magnus Hagander , , pgsql-bugs Subject: Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year Message-ID: <20141107155144.GH4482@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> <20141106142949.GA4487@gr8.dev> <20141107070257.GA29045@momjian.us> <20141107151611.GD4482@gr8.dev> <4926.1415374857@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <4926.1415374857@sss.pgh.pa.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-07_07:2014-11-07,2014-11-07,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-1411070129 X-Pg-Spam-Score: -1.3 (-) 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 07 Nov 14 10 40, Tom Lane wrote: > Bruce Hunsaker writes: > > Just to add some additional background, We were migrating data from > > an Oracle DB when we hit this. Oracle's dates are Julian based > > and range from Jan 1, 4712 BCE to Dec 31 9999 CE. So Feb 29, 1500 > > is a valid date in an Oracle Date type (Julian day 2268992). So I > > wonder what the rules might be to convert a Julian date to a > > 'proleptic Gregorian' date (pre 1582) and vice versa? > > I think you have a bigger data-integrity problem than you realize. > Perhaps I'm jumping to conclusions based on your return address, > but I suppose what you've got here is a database of historical > birth and death records from lots of different countries? Your > problem, as I mentioned upthread, is that you're going to need some > context to figure out whether any given recorded date was meant as > Julian or Gregorian. If you don't know that for sure, applying a > transformation that's only going to be right for 80% or 90% of your > data will make things worse not better. I was thinking the same thing after my last post. > In the short term you'd probably be best off just storing the Oracle > output as text. You could consider converting it to some type with > stronger semantics later, but you'll have enough on your plate > making the switch at all. That's an excellent suggestion. I'm going to advise that we store the Oracle output as text, so the original value gets preserved. -- 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