Re: Inconsistent results in timestamp/interval comparison

2024-03-04 Thread Francisco Olarte
On Mon, 4 Mar 2024 at 14:06, wrote: > Am 04.03.2024 13:45 schrieb Francisco Olarte: > > Intervals are composed of months, days and seconds, as not every month > > has 30 days and not every day has 86400 seconds, so to compare them > > you have to normalize them somehow, which can lead to bizarre r

Re: Inconsistent results in timestamp/interval comparison

2024-03-04 Thread albrecht . dress
Am 04.03.2024 13:45 schrieb Francisco Olarte: Intervals are composed of months, days and seconds, as not every month has 30 days and not every day has 86400 seconds, so to compare them you have to normalize them somehow, which can lead to bizarre results. Ah, I see, thanks for the explanation.

Re: Inconsistent results in timestamp/interval comparison

2024-03-04 Thread Alban Hertroys
On Mon, 4 Mar 2024 at 13:46, Francisco Olarte wrote: > On Mon, 4 Mar 2024 at 13:10, wrote: > > According to the documentation, Table 9.31, IMHO both comparisons should > > produce the same results, as > > > timestamp - timestamp → interval > > timestamp + interval → timestamp > Your problem may

Re: Inconsistent results in timestamp/interval comparison

2024-03-04 Thread Francisco Olarte
On Mon, 4 Mar 2024 at 13:10, wrote: > According to the documentation, Table 9.31, IMHO both comparisons should > produce the same results, as > timestamp - timestamp → interval > timestamp + interval → timestamp Your problem may be due to interval comparison. Intervals are composed of months, da

Inconsistent results in timestamp/interval comparison

2024-03-04 Thread albrecht . dress
Hi all, I run the “official” deb package postgresql-16 v. 16.2-1.pgdg120+2 on a Debian Bookworm system, and observed a confusing behavior in a calculation with time stamps and intervals. To reproduce, consider the following trivial example: create table testtab (t1 timestamp without time zo