From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Bruce Hunsaker <hunsakerbn@ldschurch.org>
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, 07 Nov 2014 10:06:26 -0500
Message-ID: <3189.1415372786@sss.pgh.pa.us> (raw)
In-Reply-To: <20141107132503.GM1791@alvin.alvh.no-ip.org>
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>
<20141107132503.GM1791@alvin.alvh.no-ip.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> I agree we don't want a simplistic change that would only change the
> rule from Gregorian to Julian without much other thinking; but suppose
> Bruce H was able to come up with a well reasoned design to cover all
> interesting cases, would we consider accepting a patch that changed the
> behavior?
Meh. Using Julian calendar from circa 50 BC to 1582 is the "right thing"
in some abstract sense, but:
1. What ya gonna do before 50 BC? If your argument against proleptic
Gregorian is that it doesn't represent what people actually did, then
replacing it with proleptic Julian is no better.
2. There's that two weeks or so that completely disappeared in the switch.
Those are dates we'd no longer accept (or at least if we did, it's none
too clear what we'd do with them). This creates a dump/reload hazard.
3. Between #2 and the altered frequency of leap years, stored dates
before 1582 would change meaning rather substantially, so that the
results of pg_upgrade would differ from a dump/reload.
4. We'd be adding a substantial amount of complexity, cycles, and possibly
bugs to all datetime operations, in service of what is evidently a tiny
minority requirement (and one that not only lacks support in the SQL
standard, but is arguably contrary to the express wording of same).
5. A side issue that's probably pretty relevant for the OP's application
is that not every country adopted the Gregorian calendar at the same time.
Really if he wants any data integrity he's going to need to store an
explicit indication of whether a date is in Julian or Gregorian calendar.
(In a world of infinite manpower you could imagine extending the zic
database to provide information about which calendar was used when in
every region, but I don't see us going there.)
So the risk/reward/backwards-compatibility tradeoff just doesn't look
very good from here.
I think the OP's best bet is to store old dates as text, or perhaps
integers, with some CHECK constraints to make whatever validity checks
he deems appropriate.
> I would also go as far as suggesting that a different data
> type might be a useful direction to consider.
Yeah, an extension data type is also a possibility, but it'd be a
significant amount of work.
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
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: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, bruce@momjian.us, hunsakerbn@ldschurch.org, 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: <3189.1415372786@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> <20141107132503.GM1791@alvin.alvh.no-ip.org> <3189.1415372786@sss.pgh.pa.us>
* 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