Re: truncating timestamps on arbitrary intervals

John Naylor <john.naylor@enterprisedb.com>

From: John Naylor <john.naylor@enterprisedb.com>
To: Erik Rijkers <er@xs4all.nl>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-03-24T18:01:58Z
Lists: pgsql-hackers
On Wed, Mar 24, 2021 at 1:25 PM Erik Rijkers <er@xs4all.nl> wrote:
>
> 'In cases full units' seems strange.
>
> Not a native speaker but maybe the attached changes are improvements?

-    In cases full units (1 minute, 1 hour, etc.), it gives the same result
as
+    In case of full units (1 minute, 1 hour, etc.), it gives the same
result as
     the analogous <function>date_trunc</function> call, but the difference
is
     that <function>date_bin</function> can truncate to an arbitrary
interval.
    </para>

I would say "In the case of"

    <para>
-    The <parameter>stride</parameter> interval cannot contain units of
month
+    The <parameter>stride</parameter> interval cannot contain units of a
month
     or larger.

The original seems fine to me here.

--
John Naylor
EDB: http://www.enterprisedb.com

Commits

  1. Disallow negative strides in date_bin()

  2. Improve behavior of date_bin with origin in the future

  3. doc: Additional documentation for date_bin

  4. Add date_bin function