X-Original-To: pgsql-patches-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 192009FA294 for ; Wed, 17 May 2006 21:01:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 16838-01 for ; Wed, 17 May 2006 21:01:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from bottom.rox.net (bottom.rox.net [213.214.0.43]) by postgresql.org (Postfix) with ESMTP id 957E39F9CEE for ; Wed, 17 May 2006 21:01:45 -0300 (ADT) Received: from localhost ([127.0.0.1]) by bottom.rox.net with esmtp (Exim 4.62) (envelope-from ) id 1FgVxY-00077u-0o for pgsql-patches@postgresql.org; Thu, 18 May 2006 02:01:44 +0200 Received: from [87.217.68.149] (helo=mcknight.kawo2.rwth-aachen.de) by bottom.rox.net with esmtpa (Exim 4.62) (envelope-from ) id 1FgVxW-00077l-Ui for pgsql-patches@postgresql.org; Thu, 18 May 2006 02:01:43 +0200 Received: by mcknight.kawo2.rwth-aachen.de (Postfix, from userid 1000) id 2D8424681AA; Thu, 18 May 2006 02:01:41 +0200 (CEST) Date: Thu, 18 May 2006 02:01:41 +0200 From: Joachim Wieland To: pgsql-patches@postgresql.org Subject: small doc patch for regexp_replace Message-ID: <20060518000141.GA5419@mcknight.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline X-Operating-System: Linux 2.6.13.4 on an i686 User-Agent: Mutt/1.5.9i X-Scanned-By: rockenstein AG X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/206 X-Sequence-Number: 19752 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 "text". I'd fix that if someone told me what the preferred (if any) form is... Joachim --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="regexp_replace-doc.diff" 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 **** substring(string from pattern) text ! Extract substring matching POSIX regular expression substring('Thomas' from '...$') mas --- 1112,1120 ---- substring(string from pattern) text ! Extract substring matching POSIX regular expression. See ! for more information on pattern ! matching. substring('Thomas' from '...$') mas *************** *** 1122,1129 **** substring(string from pattern for escape) text ! Extract substring matching SQL regular ! expression substring('Thomas' from '%#"o_a#"_' for '#') oma --- 1124,1132 ---- substring(string from pattern for escape) text ! Extract substring matching SQL regular expression. ! See for more information on ! pattern matching. substring('Thomas' from '%#"o_a#"_' for '#') oma *************** *** 1422,1427 **** --- 1425,1442 ---- + regexp_replace(string text, pattern text, replacement text [,flags text]) + text + + Replace substring matching POSIX regular expression. See + for more information on pattern + matching. + + regexp_replace('Thomas', '.[mN]a.', 'M') + ThM + + + repeat(string text, number int) text Repeat string the specified --C7zPtVaVf+AK4Oqc--