Re: Proposed changing the definition of decade for date_trunc and extract

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Mike Swanson <mikeonthecomputer(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposed changing the definition of decade for date_trunc and extract
Date: 2014-08-05 19:26:31
Message-ID: CA+TgmobGF46jWm57N7zcGbEMTSLrPPUfoa6_Z=PttOGvaTKyOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Aug 3, 2014 at 3:29 PM, Gavin Flower
<GavinFlower(at)archidevsys(dot)co(dot)nz> wrote:
> So it would probably be a good idea to mention in the relevant
> documentation, that there was no Year Zero, and that 1 AD follows directly
> after 1 BC.

Well, maybe. By and large, the PostgreSQL documentation should
confine itself to documenting facts about PostgreSQL rather than, say,
facts about date reckoning, except to the extent that PostgreSQL does
something different from the universal norms. I mean, we could
document the rules for leap years, too, or how many days there are in
each month, or that many people who used the Julian calendar
considered the first day of the year to be March 25th, but really,
those are things that mostly deserve to be mentioned in a treatise on
historical calendaring rather than our documentation, unless there is
some PostgreSQL-specific treatment that requires expounding on them.

On the original patch, like a few others who have spoken, I think
changing the current behavior is a bad idea. I certainly respect
Mike's desire to get the behavior right, and to set things up in the
way that makes sense to him, but if we start changing things like this
on the basis of a small number of complaints, we will piss off a lot
of users. There are many people out there who have thousands upon
thousands of lines of PostgreSQL code that they can't easily audit and
change, and the standard for doing things that might break that code
in subtle ways is, and should be, high. If what we were doing today
was outright wrong, of course I'd be in favor of changing it. But the
current behavior isn't at all unreasonable; there are two possible
definitions and we picked one. In that kind of situation, backward
compatibility concerns carry a great deal of weight. Even if, in a
vacuum, more users would have chosen to do it as Mike proposes vs.
what we actually picked, we'll make enough people unhappy by changing
it now to make it a poor decision for the project.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-08-05 19:33:23 Re: B-Tree support function number 3 (strxfrm() optimization)
Previous Message Peter Geoghegan 2014-08-05 19:15:55 Re: B-Tree support function number 3 (strxfrm() optimization)