aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2014-03-05 20:45:27 -0500
committerBruce Momjian <bruce@momjian.us>2014-03-05 20:45:27 -0500
commite2224faf17abb6b3cde0af33346835cc013fb1c0 (patch)
tree5611e416da8c1f56cf4c15bf10655c04cf3fb5e1 /doc/src
parentb44fc39fcecf58c1c93a322d71be2faee525853f (diff)
downloadpostgresql-e2224faf17abb6b3cde0af33346835cc013fb1c0.tar.gz
postgresql-e2224faf17abb6b3cde0af33346835cc013fb1c0.zip
docs: to_timestamp and to_date do minimal range checking
Initial patch from Steve Crawford
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml14
1 files changed, 14 insertions, 0 deletions
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
@@ -5785,6 +5785,20 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
<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>
templates and will be output literally. You can put a substring
in double quotes to force it to be interpreted as literal text