From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Zhihong Zhang <zhihong(at)gmail(dot)com> |
Cc: | pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Epoch from age is incorrect |
Date: | 2021-10-11 21:52:59 |
Message-ID: | CAKFQuwb5tRgZs0K_2iAzYdQ3uYcxMJ+zLObpYmx05HDpSiLCiQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Monday, October 11, 2021, Zhihong Zhang <zhihong(at)gmail(dot)com> wrote:
>
> They are several days apart. Maybe leap years are not counted properly?
>
That is related. Intervals supply integer years, months, and days (for
example). Given an integer month (or year) value there is no way to
accurately compute the number of days involved (or any subfield of day)
since you lack knowledge of which months (years) they are (generally). So
extracting an epoch from an interval is an inherently unwise thing to do.
Having done it, comparing its result to a timestamp epoch computation is
meaningless. If you can do the later then just do it as it will provide
the expected answer while the interval epoch is inherently problematic.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2021-10-11 21:56:12 | Re: Epoch from age is incorrect |
Previous Message | Mark Dilger | 2021-10-11 21:41:31 | Re: BUG #17212: pg_amcheck fails on checking temporary relations |