Re: several cases of float and integer mixup

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Dave Sharpe <davesharpe13(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: several cases of float and integer mixup
Date: 2026-12-04 08:41:11
Message-ID: d26e56cd-6613-4129-b61c-8dd940f6889e@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03.12.26 13:51, Dave Sharpe wrote:
> Regarding 0005 (ecpg dt2time): agreed, it doesn't change behaviour.
> But seeing an explicit double to int64 cast, that truncates,
> which can lose a microsecond. The backend does the same thing in
> DecodeDateTime() (at the dt2time() call), so it is easy to
> show from SQL. For example, 0.7 of a day is exactly 16:48:00, but:
>
> SELECT 'J2451187.7'::timestamp;
> 1999-01-08 16:47:59.999999
>
> SELECT 'J2451187'::timestamp + '0.7 day'::interval;
> 1999-01-08 16:48:00
>
> SELECT '0.7 day'::interval;
> 16:48:00

> Is that worth exploring (on a separate thread)?

Yes, seems to me that this could be improved.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Pyhalov 2026-12-04 08:42:32 Re: Semi-join related bug in postgres_fdw
Previous Message Peter Eisentraut 2026-12-04 08:40:03 Re: several cases of float and integer mixup