From e2224faf17abb6b3cde0af33346835cc013fb1c0 Mon Sep 17 00:00:00 2001 From: Bruce Momjian <bruce@momjian.us> Date: Wed, 5 Mar 2014 20:45:27 -0500 Subject: [PATCH] docs: to_timestamp and to_date do minimal range checking Initial patch from Steve Crawford --- doc/src/sgml/func.sgml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index a1f627cbd6c..b1ea46677c1 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -5783,6 +5783,20 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})'); </para> </listitem> + <listitem> + <para> + <function>to_timestamp</function> and <function>to_date</function> + exist to handle input formats that cannot be converted by + simple casting. These functions interpret input liberally, + with minimal error checking. While they produce valid output, + the conversion can yield unexpected results. For example, + input to these functions is not restricted by normal ranges, + thus <literal>to_date('20096040','YYYYMMDD')</literal> returns + <literal>2014-01-17</literal> rather than causing an error. + Casting does not have this behavior. + </para> + </listitem> + <listitem> <para> Ordinary text is allowed in <function>to_char</function> -- GitLab