@@ -65,54 +65,86 @@ available through operators and may be documented as operators only.
6565</Para>
6666</sect1>
6767
68- <sect1>
69- <title>String Functions</title>
68+ <sect1>
69+ <title>String Functions</title>
7070
71- <Para>
72- SQL92 defines string functions with specific syntax. Some of these
73- are implemented using other <ProductName>Postgres</ProductName> functions.
74- </Para>
71+ <Para>
72+ SQL92 defines string functions with specific syntax. Some of these
73+ are implemented using other <ProductName>Postgres</ProductName> functions.
74+ The supported string types for <acronym>SQL92</acronym> are
75+ <type>char</type>, <type>varchar</type>, and <type>text</type>.
76+ </Para>
7577
76- <Para>
77- <TABLE TOCENTRY="1">
78- <TITLE><Acronym>SQL92</Acronym> String Functions</TITLE>
79- <TGROUP COLS="4">
80- <THEAD>
81- <ROW>
82- <ENTRY>Function</ENTRY>
83- <ENTRY>Returns</ENTRY>
84- <ENTRY>Description</ENTRY>
85- <ENTRY>Example</ENTRY>
86- </ROW>
87- </THEAD>
88- <TBODY>
89- <ROW>
90- <ENTRY> position(text in text) </ENTRY>
91- <ENTRY> int4 </ENTRY>
92- <ENTRY> location of specified substring </ENTRY>
93- <ENTRY> position('o' in 'Tom') </ENTRY>
94- </ROW>
95- <ROW>
96- <ENTRY> substring(text [from int] [for int]) </ENTRY>
97- <ENTRY> text </ENTRY>
98- <ENTRY> extract specified substring </ENTRY>
99- <ENTRY> substring('Tom' from 2 for 2) </ENTRY>
100- </ROW>
101- <ROW>
102- <ENTRY> trim([leading|trailing|both] [text] from text) </ENTRY>
103- <ENTRY> text </ENTRY>
104- <ENTRY> trim characters from text </ENTRY>
105- <ENTRY> trim(both 'x' from 'xTomx') </ENTRY>
106- </ROW>
107- </TBODY>
108- </TGROUP>
109- </TABLE>
110- </Para>
78+ <Para>
79+ <TABLE TOCENTRY="1">
80+ <TITLE><Acronym>SQL92</Acronym> String Functions</TITLE>
81+ <TGROUP COLS="4">
82+ <THEAD>
83+ <ROW>
84+ <ENTRY>Function</ENTRY>
85+ <ENTRY>Returns</ENTRY>
86+ <ENTRY>Description</ENTRY>
87+ <ENTRY>Example</ENTRY>
88+ </ROW>
89+ </THEAD>
90+ <TBODY>
91+ <ROW>
92+ <ENTRY> char_length(string) </ENTRY>
93+ <ENTRY> int4 </ENTRY>
94+ <ENTRY> length of string </ENTRY>
95+ <ENTRY> char_length('jose') </ENTRY>
96+ </ROW>
97+ <ROW>
98+ <ENTRY> character_length(string) </ENTRY>
99+ <ENTRY> int4 </ENTRY>
100+ <ENTRY> length of string </ENTRY>
101+ <ENTRY> char_length('jose') </ENTRY>
102+ </ROW>
103+ <ROW>
104+ <ENTRY> lower(string) </ENTRY>
105+ <ENTRY> string </ENTRY>
106+ <ENTRY> convert string to lower case </ENTRY>
107+ <ENTRY> lower('TOM') </ENTRY>
108+ </ROW>
109+ <ROW>
110+ <ENTRY> octet_length(string) </ENTRY>
111+ <ENTRY> int4 </ENTRY>
112+ <ENTRY> storage length of string </ENTRY>
113+ <ENTRY> octet_length('jose') </ENTRY>
114+ </ROW>
115+ <ROW>
116+ <ENTRY> position(string in string) </ENTRY>
117+ <ENTRY> int4 </ENTRY>
118+ <ENTRY> location of specified substring </ENTRY>
119+ <ENTRY> position('o' in 'Tom') </ENTRY>
120+ </ROW>
121+ <ROW>
122+ <ENTRY> substring(string [from int] [for int]) </ENTRY>
123+ <ENTRY> string </ENTRY>
124+ <ENTRY> extract specified substring </ENTRY>
125+ <ENTRY> substring('Tom' from 2 for 2) </ENTRY>
126+ </ROW>
127+ <ROW>
128+ <ENTRY> trim([leading|trailing|both] [string] from string) </ENTRY>
129+ <ENTRY> string </ENTRY>
130+ <ENTRY> trim characters from string </ENTRY>
131+ <ENTRY> trim(both 'x' from 'xTomx') </ENTRY>
132+ </ROW>
133+ <ROW>
134+ <ENTRY> upper(text) </ENTRY>
135+ <ENTRY> text </ENTRY>
136+ <ENTRY> convert text to upper case </ENTRY>
137+ <ENTRY> upper('tom') </ENTRY>
138+ </ROW>
139+ </TBODY>
140+ </TGROUP>
141+ </TABLE>
142+ </Para>
111143
112- <Para>
113- Many string functions are available for text, varchar(), and char() types.
114- Some are used internally to implement the SQL92 string functions listed above.
115- </Para>
144+ <Para>
145+ Many additional string functions are available for text, varchar(), and char() types.
146+ Some are used internally to implement the SQL92 string functions listed above.
147+ </Para>
116148
117149<Para>
118150<TABLE TOCENTRY="1">
@@ -146,12 +178,6 @@ Some are used internally to implement the SQL92 string functions listed above.
146178<ENTRY> initcap('thomas') </ENTRY>
147179 </ROW>
148180 <ROW>
149- <ENTRY> lower(text) </ENTRY>
150- <ENTRY> text </ENTRY>
151- <ENTRY> convert text to lower case </ENTRY>
152- <ENTRY> lower('TOM') </ENTRY>
153- </ROW>
154- <ROW>
155181<ENTRY> lpad(text,int,text) </ENTRY>
156182<ENTRY> text </ENTRY>
157183<ENTRY> left pad string to specified length </ENTRY>
@@ -164,9 +190,9 @@ Some are used internally to implement the SQL92 string functions listed above.
164190<ENTRY> ltrim('xxxxtrim','x') </ENTRY>
165191 </ROW>
166192 <ROW>
167- <ENTRY>position (text,text) </ENTRY>
193+ <ENTRY>textpos (text,text) </ENTRY>
168194<ENTRY> text </ENTRY>
169- <ENTRY>extract specified substring </ENTRY>
195+ <ENTRY>locate specified substring </ENTRY>
170196<ENTRY> position('high','ig') </ENTRY>
171197 </ROW>
172198 <ROW>
@@ -217,12 +243,6 @@ Some are used internally to implement the SQL92 string functions listed above.
217243<ENTRY> convert text to varchar type </ENTRY>
218244<ENTRY> varchar('text string') </ENTRY>
219245 </ROW>
220- <ROW>
221- <ENTRY> upper(text) </ENTRY>
222- <ENTRY> text </ENTRY>
223- <ENTRY> convert text to upper case </ENTRY>
224- <ENTRY> upper('tom') </ENTRY>
225- </ROW>
226246</TBODY>
227247</TGROUP>
228248</TABLE>
@@ -689,3 +709,19 @@ support functions.
689709
690710</chapter>
691711
712+ <!-- Keep this comment at the end of the file
713+ Local variables:
714+ mode: sgml
715+ sgml-omittag:t
716+ sgml-shorttag:t
717+ sgml-minimize-attributes:nil
718+ sgml-always-quote-attributes:t
719+ sgml-indent-step:1
720+ sgml-indent-data:t
721+ sgml-parent-document:nil
722+ sgml-default-dtd-file:"./reference.ced"
723+ sgml-exposed-tags:nil
724+ sgml-local-catalogs:"/usr/lib/sgml/catalog"
725+ sgml-local-ecat-files:nil
726+ End:
727+ -->