pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Hunsaker <hunsakerbn@ldschurch.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: hunsakerbn@ldschurch.org
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: hunsakerbn@familysearch.org
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year
Date: Fri, 7 Nov 2014 08:51:44 -0700
Message-ID: <20141107155144.GH4482@gr8.dev> (raw)
In-Reply-To: <4926.1415374857@sss.pgh.pa.us>
References: <20141105175607.26929.23188@wrigleys.postgresql.org>
	<20141105180225.GB10345@momjian.us>
	<CABUevEzP=g=O=Nmg+DMjwCL+74WsnPdTb98vbs6sSbQq_kdASw@mail.gmail.com>
	<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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 07 Nov 14 10 40, Tom Lane wrote:
> Bruce Hunsaker <hunsakerbn@ldschurch.org> 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



view thread (16+ messages)  latest in thread

Message-ID: <20141107155144.GH4482@gr8.dev>
Permalink:  ../20141107155144.GH4482@gr8.dev/
Also on:    postgresql.org/message-id/20141107155144.GH4482@gr8.dev

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: hunsakerbn@ldschurch.org, tgl@sss.pgh.pa.us, bruce@momjian.us, magnus@hagander.net, hunsakerbn@familysearch.org
  Subject: Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year
  In-Reply-To: <20141107155144.GH4482@gr8.dev>
  References: <20141105175607.26929.23188@wrigleys.postgresql.org> <20141105180225.GB10345@momjian.us> <CABUevEzP=g=O=Nmg+DMjwCL+74WsnPdTb98vbs6sSbQq_kdASw@mail.gmail.com> <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> <20141107155144.GH4482@gr8.dev>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox