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 8410C9FA29C for ; Wed, 17 May 2006 21:54:55 -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 35330-09 for ; Wed, 17 May 2006 21:54:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from candle.pha.pa.us (candle.pha.pa.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id A12A09F9CEE for ; Wed, 17 May 2006 21:54:40 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id k4I0sb518077; Wed, 17 May 2006 20:54:37 -0400 (EDT) From: Bruce Momjian Message-Id: <200605180054.k4I0sb518077@candle.pha.pa.us> Subject: Re: small doc patch for regexp_replace In-Reply-To: <20060518000141.GA5419@mcknight.de> To: Joachim Wieland Date: Wed, 17 May 2006 20:54:37 -0400 (EDT) CC: pgsql-patches@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=ELM1147913677-672-2_ Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/207 X-Sequence-Number: 19753 --ELM1147913677-672-2_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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 > "text". > > 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. + --ELM1147913677-672-2_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/diff" 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 **** ! Functions and Operators --- 1,4 ---- ! Functions and Operators *************** *** 1244,1250 **** ! ascii(text) int ASCII code of the first byte of the argument ascii('x') --- 1244,1250 ---- ! ascii(string) int ASCII code of the first byte of the argument ascii('x') *************** *** 1274,1281 **** ! convert(string ! text, src_encoding name, dest_encoding name) --- 1274,1280 ---- ! convert(string text, src_encoding name, dest_encoding name) *************** *** 1320,1326 **** ! initcap(text) text Convert the first letter of each word to uppercase and the --- 1319,1325 ---- ! initcap(string) text Convert the first letter of each word to uppercase and the *************** *** 1332,1338 **** ! length(string text) int Number of characters in string --- 1331,1337 ---- ! length(string) int Number of characters in string *************** *** 1375,1381 **** ! md5(string text) text Calculates the MD5 hash of string, --- 1374,1380 ---- ! md5(string) text Calculates the MD5 hash of string, *************** *** 1396,1402 **** ! quote_ident(string text) text Return the given string suitably quoted to be used as an identifier --- 1395,1401 ---- ! quote_ident(string) text Return the given string suitably quoted to be used as an identifier *************** *** 1410,1416 **** ! quote_literal(string text) text Return the given string suitably quoted to be used as a string literal --- 1409,1415 ---- ! quote_literal(string) text Return the given string suitably quoted to be used as a string literal *************** *** 1511,1522 **** ! to_ascii(text ! , encoding) text ! Convert text to ASCII from another encoding The to_ascii function supports conversion from --- 1510,1521 ---- ! to_ascii(string text ! , encoding text) text ! Convert string to ASCII from another encoding The to_ascii function supports conversion from *************** *** 1543,1550 **** ! translate(string ! text, from text, to text) --- 1542,1548 ---- ! translate(string text, from text, to text) --ELM1147913677-672-2_--