1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-20 15:22:23 +03:00

Fix to_date() and to_timestamp() to handle year masks of length < 4 so

they wrap toward year 2020, rather than the inconsistent behavior we had
before.
This commit is contained in:
Bruce Momjian
2011-09-07 09:47:51 -04:00
parent 8eacb25cbe
commit 029dfdf115
2 changed files with 41 additions and 26 deletions

View File

@ -5548,6 +5548,15 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
</para>
</listitem>
<listitem>
<para>
If the year format specification is less than four digits, e.g.
<literal>YYY</>, and the supplied year is less than four digits,
the year will be adjusted to be nearest to the year 2020, e.g.
<literal>95</> becomes 1995.
</para>
</listitem>
<listitem>
<para>
The <literal>YYYY</literal> conversion from string to <type>timestamp</type> or