Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d56ea24

Browse filesBrowse files
committed
Doc: spell out comparison behaviors for the date/time types.
The behavior of cross-type comparisons among date/time data types was not really explained anywhere. You could probably infer it if you recognized the applicability of comments elsewhere about datatype conversions, but it seems worthy of explicit documentation. Per bug #16797 from Dana Burd. Discussion: https://postgr.es/m/16797-f264b0b980b53b8b@postgresql.org
1 parent b25c106 commit d56ea24
Copy full SHA for d56ea24

File tree

Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed

‎doc/src/sgml/func.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/func.sgml
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6703,6 +6703,21 @@ SELECT regexp_matches('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}');
67036703
linkend="datatype-datetime">.
67046704
</para>
67056705

6706+
<para>
6707+
In addition, the usual comparison operators shown in
6708+
<xref linkend="functions-comparison-op-table"> are available for the
6709+
date/time types. Dates and timestamps (with or without time zone) are
6710+
all comparable, while times (with or without time zone) and intervals
6711+
can only be compared to other values of the same data type. When
6712+
comparing a timestamp without time zone to a timestamp with time zone,
6713+
the former value is assumed to be given in the time zone specified by
6714+
the <xref linkend="guc-timezone"> configuration parameter, and is
6715+
rotated to UTC for comparison to the latter value (which is already
6716+
in UTC internally). Similarly, a date value is assumed to represent
6717+
midnight in the <varname>TimeZone</varname> zone when comparing it
6718+
to a timestamp.
6719+
</para>
6720+
67066721
<para>
67076722
All the functions and operators described below that take <type>time</type> or <type>timestamp</type>
67086723
inputs actually come in two variants: one that takes <type>time with time zone</type> or <type>timestamp

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.