From f3fde99841734d56699dd1e65459d105ed724d52 Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Tue, 19 Jan 1999 16:11:18 +0000 Subject: [PATCH] Augment info on string functions per Jose Soares' suggestions. --- doc/src/sgml/func.sgml | 154 +++++++++++++++++++++++++---------------- 1 file changed, 95 insertions(+), 59 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index f0381b51eca..f6b640c1b86 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -65,54 +65,86 @@ available through operators and may be documented as operators only. - -String Functions + + String Functions - -SQL92 defines string functions with specific syntax. Some of these -are implemented using other Postgres functions. - + + SQL92 defines string functions with specific syntax. Some of these + are implemented using other Postgres functions. + The supported string types for SQL92 are + char, varchar, and text. + - - -<Acronym>SQL92</Acronym> String Functions - - - - Function - Returns - Description - Example - - - - - position(text in text) - int4 - location of specified substring - position('o' in 'Tom') - - - substring(text [from int] [for int]) - text - extract specified substring - substring('Tom' from 2 for 2) - - - trim([leading|trailing|both] [text] from text) - text - trim characters from text - trim(both 'x' from 'xTomx') - - - -
-
+ + + <Acronym>SQL92</Acronym> String Functions + + + + Function + Returns + Description + Example + + + + + char_length(string) + int4 + length of string + char_length('jose') + + + character_length(string) + int4 + length of string + char_length('jose') + + + lower(string) + string + convert string to lower case + lower('TOM') + + + octet_length(string) + int4 + storage length of string + octet_length('jose') + + + position(string in string) + int4 + location of specified substring + position('o' in 'Tom') + + + substring(string [from int] [for int]) + string + extract specified substring + substring('Tom' from 2 for 2) + + + trim([leading|trailing|both] [string] from string) + string + trim characters from string + trim(both 'x' from 'xTomx') + + + upper(text) + text + convert text to upper case + upper('tom') + + + +
+
- -Many string functions are available for text, varchar(), and char() types. -Some are used internally to implement the SQL92 string functions listed above. - + + Many additional string functions are available for text, varchar(), and char() types. + Some are used internally to implement the SQL92 string functions listed above. + @@ -146,12 +178,6 @@ Some are used internally to implement the SQL92 string functions listed above. initcap('thomas') - lower(text) - text - convert text to lower case - lower('TOM') - - lpad(text,int,text) text left pad string to specified length @@ -164,9 +190,9 @@ Some are used internally to implement the SQL92 string functions listed above. ltrim('xxxxtrim','x') - position(text,text) + textpos(text,text) text - extract specified substring + locate specified substring position('high','ig') @@ -217,12 +243,6 @@ Some are used internally to implement the SQL92 string functions listed above. convert text to varchar type varchar('text string') - - upper(text) - text - convert text to upper case - upper('tom') -
@@ -689,3 +709,19 @@ support functions. +