Re: small doc patch for regexp_replace

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: small doc patch for regexp_replace
Дата
Msg-id 200605180054.k4I0sb518077@candle.pha.pa.us
обсуждение исходный текст
Ответ на small doc patch for regexp_replace  (Joachim Wieland <joe@mcknight.de>)
Ответы Re: small doc patch for regexp_replace
Список pgsql-patches
Joachim Wieland wrote:
> 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...

Seems there is some inconsistency there.  There are two types of
function listings, one with just the types, and another with param_name
and then type.  We use "string" instead of "text" because varchar() and
char() can also be used.

Anyway, applied patch attached that tries to clean it up.  Let me know
if you find others.

--
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: func.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/func.sgml,v
retrieving revision 1.316
retrieving revision 1.317
diff -c -r1.316 -r1.317
*** func.sgml    30 Apr 2006 21:15:32 -0000    1.316
--- func.sgml    18 May 2006 00:50:08 -0000    1.317
***************
*** 1,4 ****
! <!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.316 2006/04/30 21:15:32 tgl Exp $ -->

   <chapter id="functions">
    <title>Functions and Operators</title>
--- 1,4 ----
! <!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.317 2006/05/18 00:50:08 momjian Exp $ -->

   <chapter id="functions">
    <title>Functions and Operators</title>
***************
*** 1244,1250 ****

       <tbody>
        <row>
!        <entry><literal><function>ascii</function>(<type>text</type>)</literal></entry>
         <entry><type>int</type></entry>
         <entry><acronym>ASCII</acronym> code of the first byte of the argument</entry>
         <entry><literal>ascii('x')</literal></entry>
--- 1244,1250 ----

       <tbody>
        <row>
!        <entry><literal><function>ascii</function>(<type>string</type>)</literal></entry>
         <entry><type>int</type></entry>
         <entry><acronym>ASCII</acronym> code of the first byte of the argument</entry>
         <entry><literal>ascii('x')</literal></entry>
***************
*** 1274,1281 ****

        <row>
         <entry>
!         <literal><function>convert</function>(<parameter>string</parameter>
!         <type>text</type>,
          <optional><parameter>src_encoding</parameter> <type>name</type>,</optional>
          <parameter>dest_encoding</parameter> <type>name</type>)</literal>
         </entry>
--- 1274,1280 ----

        <row>
         <entry>
!         <literal><function>convert</function>(<parameter>string</parameter> <type>text</type>,
          <optional><parameter>src_encoding</parameter> <type>name</type>,</optional>
          <parameter>dest_encoding</parameter> <type>name</type>)</literal>
         </entry>
***************
*** 1320,1326 ****
        </row>

        <row>
!        <entry><literal><function>initcap</function>(<type>text</type>)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
          Convert the first letter of each word to uppercase and the
--- 1319,1325 ----
        </row>

        <row>
!        <entry><literal><function>initcap</function>(<type>string</type>)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
          Convert the first letter of each word to uppercase and the
***************
*** 1332,1338 ****
        </row>

        <row>
!        <entry><literal><function>length</function>(<parameter>string</parameter> <type>text</type>)</literal></entry>
         <entry><type>int</type></entry>
         <entry>
          Number of characters in <parameter>string</parameter>
--- 1331,1337 ----
        </row>

        <row>
!        <entry><literal><function>length</function>(<parameter>string</parameter>)</literal></entry>
         <entry><type>int</type></entry>
         <entry>
          Number of characters in <parameter>string</parameter>
***************
*** 1375,1381 ****
        </row>

        <row>
!        <entry><literal><function>md5</function>(<parameter>string</parameter> <type>text</type>)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
          Calculates the MD5 hash of <parameter>string</parameter>,
--- 1374,1380 ----
        </row>

        <row>
!        <entry><literal><function>md5</function>(<parameter>string</parameter>)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
          Calculates the MD5 hash of <parameter>string</parameter>,
***************
*** 1396,1402 ****
        </row>

        <row>
!        <entry><literal><function>quote_ident</function>(<parameter>string</parameter> text)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
          Return the given string suitably quoted to be used as an identifier
--- 1395,1401 ----
        </row>

        <row>
!        <entry><literal><function>quote_ident</function>(<parameter>string</parameter>)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
          Return the given string suitably quoted to be used as an identifier
***************
*** 1410,1416 ****
        </row>

        <row>
!        <entry><literal><function>quote_literal</function>(<parameter>string</parameter> text)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
          Return the given string suitably quoted to be used as a string literal
--- 1409,1415 ----
        </row>

        <row>
!        <entry><literal><function>quote_literal</function>(<parameter>string</parameter>)</literal></entry>
         <entry><type>text</type></entry>
         <entry>
          Return the given string suitably quoted to be used as a string literal
***************
*** 1511,1522 ****
        </row>

        <row>
!        <entry><literal><function>to_ascii</function>(<type>text</type>
!         <optional>, <parameter>encoding</parameter></optional>)</literal></entry>
         <entry><type>text</type></entry>

         <entry>
!        Convert <parameter>text</parameter> to <acronym>ASCII</acronym> from another encoding
         <footnote>
          <para>
           The <function>to_ascii</function> function supports conversion from
--- 1510,1521 ----
        </row>

        <row>
!        <entry><literal><function>to_ascii</function>(<parameter>string</parameter> <type>text</type>
!         <optional>, <parameter>encoding</parameter> <type>text</type></optional>)</literal></entry>
         <entry><type>text</type></entry>

         <entry>
!        Convert <parameter>string</parameter> to <acronym>ASCII</acronym> from another encoding
         <footnote>
          <para>
           The <function>to_ascii</function> function supports conversion from
***************
*** 1543,1550 ****

        <row>
         <entry>
!         <literal><function>translate</function>(<parameter>string</parameter>
!         <type>text</type>,
          <parameter>from</parameter> <type>text</type>,
          <parameter>to</parameter> <type>text</type>)</literal>
         </entry>
--- 1542,1548 ----

        <row>
         <entry>
!         <literal><function>translate</function>(<parameter>string</parameter> <type>text</type>,
          <parameter>from</parameter> <type>text</type>,
          <parameter>to</parameter> <type>text</type>)</literal>
         </entry>

В списке pgsql-patches по дате отправления:

Предыдущее
От: Joachim Wieland
Дата:
Сообщение: small doc patch for regexp_replace
Следующее
От: Tom Lane
Дата:
Сообщение: Re: small doc patch for regexp_replace