doc: Additional documentation for date_bin
authorPeter Eisentraut
Fri, 9 Apr 2021 19:55:08 +0000 (21:55 +0200)
committerPeter Eisentraut
Fri, 9 Apr 2021 19:55:08 +0000 (21:55 +0200)
Reported-by: Justin Pryzby
Author: John Naylor 
Discussion: https://www.postgresql.org/message-id/CAFBsxsEEm1nuhZmfVQxvu_i3nDDEuvNJ_WMrDo9whFD_jusp-A@mail.gmail.com

doc/src/sgml/func.sgml

index 67d802b02c24c15734b722d19ac460abdf433b4e..d20116340752705e0276dbc3e00958d68e181a8f 100644 (file)
@@ -9941,6 +9941,20 @@ SELECT date_trunc('hour', INTERVAL '3 days 02:47:33');
     aligned with a specified origin.
    
 
+   
+
+date_trunc(stridesourceorigin)
+
+    source is a value expression of type
+    timestamp or timestamp with time zone.  (Values
+    of type date are cast automatically to
+    timestamp.)  stride is a value
+    expression of type  interval.  The return value is likewise
+    of type timestamp or timestamp with time zone,
+    and it marks the beginning of the bin into which the
+    source is placed.
+   
+
    
     Examples:
 
@@ -9958,6 +9972,10 @@ SELECT date_bin('15 minutes', TIMESTAMP '2020-02-11 15:44:17', TIMESTAMP '2001-0
     that date_bin can truncate to an arbitrary interval.
    
 
+   
+    Negative intervals are allowed and are treated the same as positive intervals.
+   
+
    
     The stride interval cannot contain units of month
     or larger.