Re: computing dT from an interval

2021-02-23 Thread Michael J. Baars
On Mon, 2021-02-22 at 10:52 -0500, Tom Lane wrote: > "Michael J. Baars" writes: > > So how do you compute the number of seconds in 8 years? > > IMO, that's a meaningless computation, because the answer is not fixed. > Before you claim otherwise, think about the every-four-hundred-years > leap yea

Re: computing dT from an interval

2021-02-22 Thread Tom Lane
David Fetter writes: > I'm not sure whether this is a bug or an infelicity we document, but > at least in some parts of the world, this calculation doesn't comport > with the calendar in place at the time: > SELECT to_timestamp('1753', '') - to_timestamp('1752', ''); Yeah, Appendix B.6 me

Re: computing dT from an interval

2021-02-22 Thread David Fetter
On Mon, Feb 22, 2021 at 10:52:42AM -0500, Tom Lane wrote: > "Michael J. Baars" writes: > > So how do you compute the number of seconds in 8 years? > > IMO, that's a meaningless computation, because the answer is not fixed. > Before you claim otherwise, think about the every-four-hundred-years > l

Re: computing dT from an interval

2021-02-22 Thread Tom Lane
"Michael J. Baars" writes: > So how do you compute the number of seconds in 8 years? IMO, that's a meaningless computation, because the answer is not fixed. Before you claim otherwise, think about the every-four-hundred-years leap year exception in the Gregorian rules. Besides, what if the quest

Re: computing dT from an interval

2021-02-22 Thread Michael J. Baars
On Sat, 2021-02-20 at 11:20 -0500, Tom Lane wrote: > "Michael J. Baars" writes: > > Can someone please tell me which of these two queries gives the correct > > result and which one the incorrect? > > // 2.922 (&) > > with A1 as ( select make_interval (0, 0, 0, 0, 0, 0, ( extract ( epoch from

Re: computing dT from an interval

2021-02-20 Thread Tom Lane
"Michael J. Baars" writes: > Can someone please tell me which of these two queries gives the correct > result and which one the incorrect? > // 2.922 (&) > with A1 as ( select make_interval (0, 0, 0, 0, 0, 0, ( extract ( epoch from > interval '8 years' ) / 1000 ) ) as "00" ) select ( extra

computing dT from an interval

2021-02-20 Thread Michael J. Baars
Hi, Can someone please tell me which of these two queries gives the correct result and which one the incorrect? /* * * * * dT in days for 1000 samples */ // 2.922 (&) with A1 as ( select make_interval (0, 0, 0, 0, 0, 0, ( extract ( epoch from interval '8 years' ) / 1000 ) ) as "00"