Re: [PATCHES] small doc patch for regexp_replace
Patch applied. Thanks. Your documentation changes can be viewed in five minutes using links on the developer's page, http://www.postgresql.org/developer/testing. --- 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 typetext/type. I'd fix that if someone told me what the preferred (if any) form is... Joachim [ Attachment, skipping... ] ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings -- Bruce Momjian http://candle.pha.pa.us EnterpriseDBhttp://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [PATCHES] small doc patch for regexp_replace
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 typetext/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 EnterpriseDBhttp://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 - 1.316 --- func.sgml 18 May 2006 00:50:08 - 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 titleFunctions 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 titleFunctions and Operators/title *** *** 1244,1250 tbody row !entryliteralfunctionascii/function(typetext/type)/literal/entry entrytypeint/type/entry entryacronymASCII/acronym code of the first byte of the argument/entry entryliteralascii('x')/literal/entry --- 1244,1250 tbody row !entryliteralfunctionascii/function(typestring/type)/literal/entry entrytypeint/type/entry entryacronymASCII/acronym code of the first byte of the argument/entry entryliteralascii('x')/literal/entry *** *** 1274,1281 row entry ! literalfunctionconvert/function(parameterstring/parameter ! typetext/type, optionalparametersrc_encoding/parameter typename/type,/optional parameterdest_encoding/parameter typename/type)/literal /entry --- 1274,1280 row entry ! literalfunctionconvert/function(parameterstring/parameter typetext/type, optionalparametersrc_encoding/parameter typename/type,/optional parameterdest_encoding/parameter typename/type)/literal /entry *** *** 1320,1326 /row row !entryliteralfunctioninitcap/function(typetext/type)/literal/entry entrytypetext/type/entry entry Convert the first letter of each word to uppercase and the --- 1319,1325 /row row !entryliteralfunctioninitcap/function(typestring/type)/literal/entry entrytypetext/type/entry entry Convert the first letter of each word to uppercase and the *** *** 1332,1338 /row row !entryliteralfunctionlength/function(parameterstring/parameter typetext/type)/literal/entry entrytypeint/type/entry entry Number of characters in parameterstring/parameter --- 1331,1337 /row row !entryliteralfunctionlength/function(parameterstring/parameter)/literal/entry entrytypeint/type/entry entry Number of characters in parameterstring/parameter *** *** 1375,1381 /row row !entryliteralfunctionmd5/function(parameterstring/parameter typetext/type)/literal/entry entrytypetext/type/entry entry Calculates the MD5 hash of parameterstring/parameter, --- 1374,1380 /row row !entryliteralfunctionmd5/function(parameterstring/parameter)/literal/entry entrytypetext/type/entry entry Calculates the MD5 hash of parameterstring/parameter, *** *** 1396,1402 /row row !entryliteralfunctionquote_ident/function(parameterstring/parameter text)/literal/entry entrytypetext/type/entry entry Return the given string suitably quoted to be used as an identifier --- 1395,1401 /row row !entryliteralfunctionquote_ident/function(parameterstring/parameter)/literal/entry entrytypetext/type/entry entry Return the given string suitably quoted to be used
Re: [PATCHES] small doc patch for regexp_replace
Bruce Momjian pgman@candle.pha.pa.us writes: 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. Where did that come from? The actual functions generally take text, relying on implicit conversions to handle the other types. Since we do not have any type named string, I think the locution typestring/ is a contradiction in terms. IMHO these should all go back to typetext/. regards, tom lane ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [PATCHES] Small doc patch for area() function...
Doc patch applied. The geometry diff you attached is related to negative zeros. I think you will find geometry_1.out will be a better match for you. I thought our code now automatically picked the proper geometry file. However, I can't find out how that file is used. --- Sean Chittenden wrote: Small patch that adds some documentation for the area() function. Specifically, point out that intersecting points in a path will yield (most likely), unexpected results. Visually these are identical paths, but mathematically they're not the same. Ex: area | plan -- +--- --- -0 | ((0,0),(0,1),(2,1),(2,2),(1,2),(1,0),(0,0)) 2 | ((0,0),(0,1),(1,1),(1,2),(2,2),(2,1),(1,1),(1,0),(0,0)) The current algorithm for area(PATH) is very quick, but only handles non-intersecting paths. I'm going to work on two other functions for the PATH data type that determines if a PATH is intersecting or not, and a function that returns the area() for an intersecting PATH. The intersecting area() function will be considerably slower (I think it's going to be O(n!) or worse instead of the current O(n), but that comes with the territory). -sc [ Attachment, skipping... ] PS Right now I'm developing on OS-X and there's a geometry regression test that's returning -0. FWIW *** ./expected/geometry.out Fri Oct 31 19:07:07 2003 --- ./results/geometry.out Thu May 27 22:16:58 2004 *** *** 117,123 | (5.1,34.5) | [(1,2),(3,4)] | (3,4) | (-5,-12) | [(1,2),(3,4)] | (1,2) | (10,10)| [(1,2),(3,4)] | (3,4) ! | (0,0) | [(0,0),(6,6)] | (-0,0) | (-10,0)| [(0,0),(6,6)] | (0,0) | (-3,4) | [(0,0),(6,6)] | (0.5,0.5) | (5.1,34.5) | [(0,0),(6,6)] | (6,6) --- 117,123 | (5.1,34.5) | [(1,2),(3,4)] | (3,4) | (-5,-12) | [(1,2),(3,4)] | (1,2) | (10,10)| [(1,2),(3,4)] | (3,4) ! | (0,0) | [(0,0),(6,6)] | (0,0) | (-10,0)| [(0,0),(6,6)] | (0,0) | (-3,4) | [(0,0),(6,6)] | (0.5,0.5) | (5.1,34.5) | [(0,0),(6,6)] | (6,6) == -- Sean Chittenden ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [PATCHES] Small Doc Patch
Patch applied to HEAD and 7.4CVS. Thanks. --- Stephan Szabo wrote: Here's a patch that adds some text mentioning that RESTRICT is not deferrable to the create table reference page. Content-Description: [ Attachment, skipping... ] ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])