Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e2224fa

Browse files
committed
docs: to_timestamp and to_date do minimal range checking
Initial patch from Steve Crawford
1 parent b44fc39 commit e2224fa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/src/sgml/func.sgml

+14
Original file line numberDiff line numberDiff line change
@@ -5783,6 +5783,20 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
57835783
</para>
57845784
</listitem>
57855785

5786+
<listitem>
5787+
<para>
5788+
<function>to_timestamp</function> and <function>to_date</function>
5789+
exist to handle input formats that cannot be converted by
5790+
simple casting. These functions interpret input liberally,
5791+
with minimal error checking. While they produce valid output,
5792+
the conversion can yield unexpected results. For example,
5793+
input to these functions is not restricted by normal ranges,
5794+
thus <literal>to_date('20096040','YYYYMMDD')</literal> returns
5795+
<literal>2014-01-17</literal> rather than causing an error.
5796+
Casting does not have this behavior.
5797+
</para>
5798+
</listitem>
5799+
57865800
<listitem>
57875801
<para>
57885802
Ordinary text is allowed in <function>to_char</function>

0 commit comments

Comments
 (0)