diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2024-07-27 15:38:54 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2024-07-27 15:38:54 -0400 |
commit | da4017a694de0610bd5b3a54adda311e46e26300 (patch) | |
tree | 43ac1fc3f0b5ada61f0588a8e61c9cf9586cccdc /doc/src | |
parent | 17a5871d9d58ea639b6d1ba4f0ce58462d55a33c (diff) | |
download | postgresql-da4017a694de0610bd5b3a54adda311e46e26300.tar.gz postgresql-da4017a694de0610bd5b3a54adda311e46e26300.zip |
Doc: fix text's description of regexp_replace's arguments.
Section 9.7.3 had a syntax synopsis for regexp_replace()
that was different from Table 9.10's, but still wrong.
Update that one too. Oversight in 580f8727c.
Jian He
Discussion: https://postgr.es/m/CACJufxG3NFKKsh6x4fRLv8h3V-HvN4W5dA=zNKMxsNcDwOKang@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index b669ab7f977..b39f97dc8de 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -3426,7 +3426,7 @@ SELECT NOT(ROW(table.*) IS NOT NULL) FROM TABLE; -- detect at least one null in <primary>regexp_replace</primary> </indexterm> <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> ] ) + <optional>, <parameter>flags</parameter> <type>text</type> </optional> ) <returnvalue>text</returnvalue> </para> <para> @@ -3445,8 +3445,8 @@ SELECT NOT(ROW(table.*) IS NOT NULL) FROM TABLE; -- detect at least one null in <entry role="func_table_entry"><para role="func_signature"> <function>regexp_replace</function> ( <parameter>string</parameter> <type>text</type>, <parameter>pattern</parameter> <type>text</type>, <parameter>replacement</parameter> <type>text</type>, <parameter>start</parameter> <type>integer</type> - [, <parameter>N</parameter> <type>integer</type> - [, <parameter>flags</parameter> <type>text</type> ] ] ) + <optional>, <parameter>N</parameter> <type>integer</type> + <optional>, <parameter>flags</parameter> <type>text</type> </optional> </optional> ) <returnvalue>text</returnvalue> </para> <para> @@ -6117,13 +6117,13 @@ SELECT col1, (SELECT regexp_matches(col2, '(bar)(beque)')) FROM tab; It has the syntax <function>regexp_replace</function>(<replaceable>string</replaceable>, <replaceable>pattern</replaceable>, <replaceable>replacement</replaceable> - <optional>, <replaceable>start</replaceable> + <optional>, <replaceable>flags</replaceable> </optional>) + or + <function>regexp_replace</function>(<replaceable>string</replaceable>, + <replaceable>pattern</replaceable>, <replaceable>replacement</replaceable>, + <replaceable>start</replaceable> <optional>, <replaceable>N</replaceable> - </optional></optional> - <optional>, <replaceable>flags</replaceable> </optional>). - (Notice that <replaceable>N</replaceable> cannot be specified - unless <replaceable>start</replaceable> is, - but <replaceable>flags</replaceable> can be given in any case.) + <optional>, <replaceable>flags</replaceable> </optional></optional>). The source <replaceable>string</replaceable> is returned unchanged if there is no match to the <replaceable>pattern</replaceable>. If there is a match, the <replaceable>string</replaceable> is returned with the |