summaryrefslogtreecommitdiff
path: root/doc/src/sgml/func.sgml
diff options
context:
space:
mode:
authorTom Lane2025-01-22 20:18:40 +0000
committerTom Lane2025-01-22 20:18:50 +0000
commit172e6b3adb2e2749883ad0746172e4cf97139961 (patch)
tree9adaf69a8bbd51298bdc6385dc7a56b7f7501ca0 /doc/src/sgml/func.sgml
parentf0ee648527e54c465e398d993db892af61a228da (diff)
Support RN (roman-numeral format) in to_number().
We've long had roman-numeral output support in to_char(), but lacked the reverse conversion. Here it is. Author: Hunaid Sohail <[email protected]> Reviewed-by: Maciek Sakrejda <[email protected]> Reviewed-by: Tom Lane <[email protected]> Reviewed-by: Tomas Vondra <[email protected]> Discussion: https://postgr.es/m/CAMWA6ybh4M1VQqpmnu2tfSwO+3gAPeA8YKnMHVADeB=XDEvT_A@mail.gmail.com
Diffstat (limited to 'doc/src/sgml/func.sgml')
-rw-r--r--doc/src/sgml/func.sgml17
1 files changed, 15 insertions, 2 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 47370e581ae..5678e7621a5 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -8669,8 +8669,8 @@ SELECT regexp_match('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}');
<entry>plus/minus sign in specified position</entry>
</row>
<row>
- <entry><literal>RN</literal></entry>
- <entry>Roman numeral (input between 1 and 3999)</entry>
+ <entry><literal>RN</literal> or <literal>rn</literal></entry>
+ <entry>Roman numeral (values between 1 and 3999)</entry>
</row>
<row>
<entry><literal>TH</literal> or <literal>th</literal></entry>
@@ -8798,6 +8798,19 @@ SELECT regexp_match('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}');
(e.g., <literal>9.99EEEE</literal> is a valid pattern).
</para>
</listitem>
+
+ <listitem>
+ <para>
+ In <function>to_number()</function>, the <literal>RN</literal>
+ pattern converts Roman numerals (in standard form) to numbers.
+ Input is case-insensitive, so <literal>RN</literal>
+ and <literal>rn</literal> are equivalent. <literal>RN</literal>
+ cannot be used in combination with any other formatting patterns or
+ modifiers except <literal>FM</literal>, which is applicable only
+ in <function>to_char()</function> and is ignored
+ in <function>to_number()</function>.
+ </para>
+ </listitem>
</itemizedlist>
</para>