On Fri, 17 Jan 2020 at 17:52, Bruce Momjian <br...@momjian.us> wrote:


> I assume there is enough agreement that decades start on 20X0 that we
> don't need to document that Postgres does that.
>

I think the inconsistency between years, decades, centuries, and millenia
is worthy of documentation. In fact, it already is for EXTRACT:

https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT

It describes decade as "The year field divided by 10", whereas for century
and millennium it refers to centuries and millennia beginning in '01 years.
I think if I were designing EXTRACT I would probably have decades follow
the pattern of century and millennium, mostly because if somebody wants
year / 10 they can just write that. But I am, to say the least, not
proposing any modifications to this particular API, for multiple reasons
which I'm sure almost any reader of this list will agree with.

Reply via email to