git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b44fc39)
docs: to_timestamp and to_date do minimal range checking
Thu, 6 Mar 2014 01:45:27 +0000 (20:45 -0500)
Thu, 6 Mar 2014 01:45:27 +0000 (20:45 -0500)
Initial patch from Steve Crawford


diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index a1f627cbd6cf9d5bbb71abea93380b3fd79bf912..b1ea46677c175037cc44b5c5e24314dd6be31cc6 100644 (file)
--- 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>
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /