Re: Decade indication

2020-01-20 Thread Isaac Morland
On Fri, 17 Jan 2020 at 17:52, Bruce Momjian 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

Re: Decade indication

2020-01-17 Thread Bruce Momjian
On Thu, Jan 2, 2020 at 08:52:17AM -0500, Tom Lane wrote: > Robert Haas writes: > > On Wed, Jan 1, 2020 at 11:01 PM Tom Lane wrote: > >> I see Randall Munroe has weighed in on this topic: > >> https://xkcd.com/2249/ > > > And the conclusion is ... the whole discussion is stupid? > > Well, it's

Re: Decade indication

2020-01-02 Thread Tom Lane
Robert Haas writes: > On Wed, Jan 1, 2020 at 11:01 PM Tom Lane wrote: >> I see Randall Munroe has weighed in on this topic: >> https://xkcd.com/2249/ > And the conclusion is ... the whole discussion is stupid? Well, it's not terribly useful anyway. Arguments founded on an assumption that

Re: Decade indication

2020-01-02 Thread Robert Haas
On Wed, Jan 1, 2020 at 11:01 PM Tom Lane wrote: > Bruce Momjian writes: > > Does the next decade start on 2020-01-01 or 2021-01-01? > > I see Randall Munroe has weighed in on this topic: > > https://xkcd.com/2249/ And the conclusion is ... the whole discussion is stupid? -- Robert Haas

Re: Decade indication

2020-01-01 Thread Tom Lane
Bruce Momjian writes: > Does the next decade start on 2020-01-01 or 2021-01-01? I see Randall Munroe has weighed in on this topic: https://xkcd.com/2249/ regards, tom lane

Re: Decade indication

2019-12-31 Thread Tom Lane
Andrew Dunstan writes: > On Wed, Jan 1, 2020 at 3:05 AM Bruce Momjian wrote: >> Does the next decade start on 2020-01-01 or 2021-01-01? Postgres says >> it start on the former date: >> ... >> That seems inconsistent to me. /pgtop/src/backend/utils/adt/timestamp.c >> has this C comment: >> >>

Re: Decade indication

2019-12-31 Thread Andrew Dunstan
On Wed, Jan 1, 2020 at 3:05 AM Bruce Momjian wrote: > > Does the next decade start on 2020-01-01 or 2021-01-01? Postgres says > it start on the former date: > > SELECT EXTRACT(DECADE FROM '2019-01-01'::date); > date_part > --- >201 > >

Re: Decade indication

2019-12-31 Thread Glyn Astill
Funnily enough I was having a conversation with my wife on exactly this as I opened your email. If the Wikipedia article is to be trusted, the following seems fitting:   SELECT EXTRACT(ORDINAL DECADE FROM '2020-01-01'::date);     date_part     ---           201 And the default:

Decade indication

2019-12-31 Thread Bruce Momjian
Does the next decade start on 2020-01-01 or 2021-01-01? Postgres says it start on the former date: SELECT EXTRACT(DECADE FROM '2019-01-01'::date); date_part --- 201 SELECT EXTRACT(DECADE FROM '2020-01-01'::date); date_part