doc: adjust to_timestamp()/to_date() wording
Discussion: https://postgr.es/m/20190706202425.GA16933@telsasoft.com Author: Justin Pryzby Backpatch-through: 12
This commit is contained in:
parent
ba09342518
commit
38c268dde0
|
@ -6420,20 +6420,20 @@ SELECT regexp_match('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}');
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
If <literal>FX</literal> is specified, a separator in the template string
|
If <literal>FX</literal> is specified, a separator in the template string
|
||||||
matches exactly one character in input string. Notice we don't insist the
|
matches exactly one character in the input string. But note that the
|
||||||
input string character be the same as the template string separator.
|
input string character is not required to be the same as the separator from the template string.
|
||||||
For example, <literal>to_timestamp('2000/JUN', 'FXYYYY MON')</literal>
|
For example, <literal>to_timestamp('2000/JUN', 'FXYYYY MON')</literal>
|
||||||
works, but <literal>to_timestamp('2000/JUN', 'FXYYYY MON')</literal>
|
works, but <literal>to_timestamp('2000/JUN', 'FXYYYY MON')</literal>
|
||||||
returns an error because the second template string space is consumed
|
returns an error because the second space in the template string consumes
|
||||||
by the letter <literal>J</literal> in the input string.
|
the letter <literal>J</literal> from the input string.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
A <literal>TZH</literal> template pattern can match a signed number.
|
A <literal>TZH</literal> template pattern can match a signed number.
|
||||||
Without the <literal>FX</literal> option, it can lead to ambiguity in
|
Without the <literal>FX</literal> option, minus signs may be ambiguous,
|
||||||
interpretation of the minus sign, which can also be interpreted as a separator.
|
and could be interpreted as a separator.
|
||||||
This ambiguity is resolved as follows: If the number of separators before
|
This ambiguity is resolved as follows: If the number of separators before
|
||||||
<literal>TZH</literal> in the template string is less than the number of
|
<literal>TZH</literal> in the template string is less than the number of
|
||||||
separators before the minus sign in the input string, the minus sign
|
separators before the minus sign in the input string, the minus sign
|
||||||
|
|
Loading…
Reference in New Issue