Re: truncating timestamps on arbitrary intervals

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: truncating timestamps on arbitrary intervals
Date: 2021-04-10 11:42:57
Message-ID: 18539c1b-b672-2328-731c-38ee00fdd966@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 30.03.21 18:06, John Naylor wrote:
> Currently, when the origin is after the input, the result is the
> timestamp at the end of the bin, rather than the beginning as expected.
> The attached puts the result consistently at the beginning of the bin.

In the patch

+ if (origin > timestamp && stride_usecs > 1)
+ tm_delta -= stride_usecs;

is the condition stride_usecs > 1 really necessary? My assessment is
that it's not, in which case it would be better to omit it.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-04-10 12:53:04 Re: Replication slot stats misgivings
Previous Message Daniel Westermann (DWE) 2021-04-10 07:56:36 Re: check_function_bodies: At least the description seems wrong, since we have prodedures