Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
f3fde998
Commit
f3fde998
authored
Jan 19, 1999
by
Thomas G. Lockhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Augment info on string functions per Jose Soares' suggestions.
parent
bda62466
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
59 deletions
+95
-59
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+95
-59
No files found.
doc/src/sgml/func.sgml
View file @
f3fde998
...
...
@@ -65,54 +65,86 @@ available through operators and may be documented as operators only.
</Para>
</sect1>
<sect1>
<title>String Functions</title>
<sect1>
<title>String Functions</title>
<Para>
SQL92 defines string functions with specific syntax. Some of these
are implemented using other <ProductName>Postgres</ProductName> functions.
</Para>
<Para>
SQL92 defines string functions with specific syntax. Some of these
are implemented using other <ProductName>Postgres</ProductName> functions.
The supported string types for <acronym>SQL92</acronym> are
<type>char</type>, <type>varchar</type>, and <type>text</type>.
</Para>
<Para>
<TABLE TOCENTRY="1">
<TITLE><Acronym>SQL92</Acronym> String Functions</TITLE>
<TGROUP COLS="4">
<THEAD>
<ROW>
<ENTRY>Function</ENTRY>
<ENTRY>Returns</ENTRY>
<ENTRY>Description</ENTRY>
<ENTRY>Example</ENTRY>
</ROW>
</THEAD>
<TBODY>
<ROW>
<ENTRY> position(text in text) </ENTRY>
<ENTRY> int4 </ENTRY>
<ENTRY> location of specified substring </ENTRY>
<ENTRY> position('o' in 'Tom') </ENTRY>
</ROW>
<ROW>
<ENTRY> substring(text [from int] [for int]) </ENTRY>
<ENTRY> text </ENTRY>
<ENTRY> extract specified substring </ENTRY>
<ENTRY> substring('Tom' from 2 for 2) </ENTRY>
</ROW>
<ROW>
<ENTRY> trim([leading|trailing|both] [text] from text) </ENTRY>
<ENTRY> text </ENTRY>
<ENTRY> trim characters from text </ENTRY>
<ENTRY> trim(both 'x' from 'xTomx') </ENTRY>
</ROW>
</TBODY>
</TGROUP>
</TABLE>
</Para>
<Para>
<TABLE TOCENTRY="1">
<TITLE><Acronym>SQL92</Acronym> String Functions</TITLE>
<TGROUP COLS="4">
<THEAD>
<ROW>
<ENTRY>Function</ENTRY>
<ENTRY>Returns</ENTRY>
<ENTRY>Description</ENTRY>
<ENTRY>Example</ENTRY>
</ROW>
</THEAD>
<TBODY>
<ROW>
<ENTRY> char_length(string) </ENTRY>
<ENTRY> int4 </ENTRY>
<ENTRY> length of string </ENTRY>
<ENTRY> char_length('jose') </ENTRY>
</ROW>
<ROW>
<ENTRY> character_length(string) </ENTRY>
<ENTRY> int4 </ENTRY>
<ENTRY> length of string </ENTRY>
<ENTRY> char_length('jose') </ENTRY>
</ROW>
<ROW>
<ENTRY> lower(string) </ENTRY>
<ENTRY> string </ENTRY>
<ENTRY> convert string to lower case </ENTRY>
<ENTRY> lower('TOM') </ENTRY>
</ROW>
<ROW>
<ENTRY> octet_length(string) </ENTRY>
<ENTRY> int4 </ENTRY>
<ENTRY> storage length of string </ENTRY>
<ENTRY> octet_length('jose') </ENTRY>
</ROW>
<ROW>
<ENTRY> position(string in string) </ENTRY>
<ENTRY> int4 </ENTRY>
<ENTRY> location of specified substring </ENTRY>
<ENTRY> position('o' in 'Tom') </ENTRY>
</ROW>
<ROW>
<ENTRY> substring(string [from int] [for int]) </ENTRY>
<ENTRY> string </ENTRY>
<ENTRY> extract specified substring </ENTRY>
<ENTRY> substring('Tom' from 2 for 2) </ENTRY>
</ROW>
<ROW>
<ENTRY> trim([leading|trailing|both] [string] from string) </ENTRY>
<ENTRY> string </ENTRY>
<ENTRY> trim characters from string </ENTRY>
<ENTRY> trim(both 'x' from 'xTomx') </ENTRY>
</ROW>
<ROW>
<ENTRY> upper(text) </ENTRY>
<ENTRY> text </ENTRY>
<ENTRY> convert text to upper case </ENTRY>
<ENTRY> upper('tom') </ENTRY>
</ROW>
</TBODY>
</TGROUP>
</TABLE>
</Para>
<Para>
Many
string functions are available for text, varchar(), and char() types.
Some are used internally to implement the SQL92 string functions listed above.
</Para>
<Para>
Many additional
string functions are available for text, varchar(), and char() types.
Some are used internally to implement the SQL92 string functions listed above.
</Para>
<Para>
<TABLE TOCENTRY="1">
...
...
@@ -146,12 +178,6 @@ Some are used internally to implement the SQL92 string functions listed above.
<ENTRY> initcap('thomas') </ENTRY>
</ROW>
<ROW>
<ENTRY> lower(text) </ENTRY>
<ENTRY> text </ENTRY>
<ENTRY> convert text to lower case </ENTRY>
<ENTRY> lower('TOM') </ENTRY>
</ROW>
<ROW>
<ENTRY> lpad(text,int,text) </ENTRY>
<ENTRY> text </ENTRY>
<ENTRY> left pad string to specified length </ENTRY>
...
...
@@ -164,9 +190,9 @@ Some are used internally to implement the SQL92 string functions listed above.
<ENTRY> ltrim('xxxxtrim','x') </ENTRY>
</ROW>
<ROW>
<ENTRY>
position
(text,text) </ENTRY>
<ENTRY>
textpos
(text,text) </ENTRY>
<ENTRY> text </ENTRY>
<ENTRY>
extract
specified substring </ENTRY>
<ENTRY>
locate
specified substring </ENTRY>
<ENTRY> position('high','ig') </ENTRY>
</ROW>
<ROW>
...
...
@@ -217,12 +243,6 @@ Some are used internally to implement the SQL92 string functions listed above.
<ENTRY> convert text to varchar type </ENTRY>
<ENTRY> varchar('text string') </ENTRY>
</ROW>
<ROW>
<ENTRY> upper(text) </ENTRY>
<ENTRY> text </ENTRY>
<ENTRY> convert text to upper case </ENTRY>
<ENTRY> upper('tom') </ENTRY>
</ROW>
</TBODY>
</TGROUP>
</TABLE>
...
...
@@ -689,3 +709,19 @@ support functions.
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"./reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog"
sgml-local-ecat-files:nil
End:
-->
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment