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

Lines changed: 14 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy