Is there any reason, why regexp_replace is not included in the tables of the
string functions?

http://developer.postgresql.org/docs/postgres/functions-string.html

The appended patch adds regexp_replace() and links to the pattern matching
section for substring / regexp_replace.

I noticed that in the table the declaration of the arguments is
inconsistent, for example:

lower(string)
ascii(text)
length(string text)

also in the sgml, there is sometimes "text" and sometimes
"<type>text</type>".

I'd fix that if someone told me what the preferred (if any) form is...


Joachim
diff -cr cvs/pgsql/doc/src/sgml/func.sgml cvs.build/pgsql/doc/src/sgml/func.sgml
*** cvs/pgsql/doc/src/sgml/func.sgml    2006-05-15 22:59:38.000000000 +0200
--- cvs.build/pgsql/doc/src/sgml/func.sgml      2006-05-18 01:34:26.000000000 
+0200
***************
*** 1112,1118 ****
         
<entry><literal><function>substring</function>(<parameter>string</parameter> 
from <replaceable>pattern</replaceable>)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
!         Extract substring matching POSIX regular expression
         </entry>
         <entry><literal>substring('Thomas' from '...$')</literal></entry>
         <entry><literal>mas</literal></entry>
--- 1112,1120 ----
         
<entry><literal><function>substring</function>(<parameter>string</parameter> 
from <replaceable>pattern</replaceable>)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
!         Extract substring matching POSIX regular expression. See
!         <xref linkend="functions-matching"> for more information on pattern
!         matching.
         </entry>
         <entry><literal>substring('Thomas' from '...$')</literal></entry>
         <entry><literal>mas</literal></entry>
***************
*** 1122,1129 ****
         
<entry><literal><function>substring</function>(<parameter>string</parameter> 
from <replaceable>pattern</replaceable> for 
<replaceable>escape</replaceable>)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
!         Extract substring matching <acronym>SQL</acronym> regular
!         expression
         </entry>
         <entry><literal>substring('Thomas' from '%#"o_a#"_' for 
'#')</literal></entry>
         <entry><literal>oma</literal></entry>
--- 1124,1132 ----
         
<entry><literal><function>substring</function>(<parameter>string</parameter> 
from <replaceable>pattern</replaceable> for 
<replaceable>escape</replaceable>)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
!         Extract substring matching <acronym>SQL</acronym> regular expression.
!         See <xref linkend="functions-matching"> for more information on
!         pattern matching.
         </entry>
         <entry><literal>substring('Thomas' from '%#"o_a#"_' for 
'#')</literal></entry>
         <entry><literal>oma</literal></entry>
***************
*** 1422,1427 ****
--- 1425,1442 ----
        </row>
  
        <row>
+        
<entry><literal><function>regexp_replace</function>(<parameter>string</parameter>
 <type>text</type>, <parameter>pattern</parameter> <type>text</type>, 
<parameter>replacement</parameter> <type>text</type> 
[,<parameter>flags</parameter> <type>text</type>])</literal></entry>
+        <entry><type>text</type></entry>
+        <entry>
+         Replace substring matching POSIX regular expression. See
+         <xref linkend="functions-matching"> for more information on pattern
+         matching.
+        </entry>
+        <entry><literal>regexp_replace('Thomas', '.[mN]a.', 
'M')</literal></entry>
+        <entry><literal>ThM</literal></entry>
+       </row>
+ 
+       <row>
         
<entry><literal><function>repeat</function>(<parameter>string</parameter> 
<type>text</type>, <parameter>number</parameter> 
<type>int</type>)</literal></entry>
         <entry><type>text</type></entry>
         <entry>Repeat <parameter>string</parameter> the specified
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to