Home Explore Blog CI



postgresql

33th chunk of `doc/src/sgml/func.sgml`
734d3f3d76096b4bce51a793c9e12a256b82b410aef017fd0000000100000fa8
 '#')</literal>
        <returnvalue>oma</returnvalue>
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>trim</primary>
        </indexterm>
        <function>trim</function> ( <optional> <literal>LEADING</literal> | <literal>TRAILING</literal> | <literal>BOTH</literal> </optional>
        <optional> <parameter>characters</parameter> <type>text</type> </optional> <literal>FROM</literal>
        <parameter>string</parameter> <type>text</type> )
        <returnvalue>text</returnvalue>
       </para>
       <para>
        Removes the longest string containing only characters in
        <parameter>characters</parameter> (a space by default) from the
        start, end, or both ends (<literal>BOTH</literal> is the default)
        of <parameter>string</parameter>.
       </para>
       <para>
        <literal>trim(both 'xyz' from 'yxTomxx')</literal>
        <returnvalue>Tom</returnvalue>
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <function>trim</function> ( <optional> <literal>LEADING</literal> | <literal>TRAILING</literal> | <literal>BOTH</literal> </optional> <optional> <literal>FROM</literal> </optional>
        <parameter>string</parameter> <type>text</type> <optional>,
        <parameter>characters</parameter> <type>text</type> </optional> )
        <returnvalue>text</returnvalue>
       </para>
       <para>
        This is a non-standard syntax for <function>trim()</function>.
       </para>
       <para>
        <literal>trim(both from 'yxTomxx', 'xyz')</literal>
        <returnvalue>Tom</returnvalue>
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>unicode_assigned</primary>
        </indexterm>
        <function>unicode_assigned</function> ( <type>text</type> )
        <returnvalue>boolean</returnvalue>
       </para>
       <para>
        Returns <literal>true</literal> if all characters in the string are
        assigned Unicode codepoints; <literal>false</literal> otherwise. This
        function can only be used when the server encoding is
        <literal>UTF8</literal>.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>upper</primary>
        </indexterm>
        <function>upper</function> ( <type>text</type> )
        <returnvalue>text</returnvalue>
       </para>
       <para>
        Converts the string to all upper case, according to the rules of the
        database's locale.
       </para>
       <para>
        <literal>upper('tom')</literal>
        <returnvalue>TOM</returnvalue>
       </para></entry>
      </row>
     </tbody>
    </tgroup>
   </table>

   <para>
    Additional string manipulation functions and operators are available
    and are listed in <xref linkend="functions-string-other"/>.  (Some of
    these are used internally to implement
    the <acronym>SQL</acronym>-standard string functions listed in
    <xref linkend="functions-string-sql"/>.)
    There are also pattern-matching operators, which are described in
    <xref linkend="functions-matching"/>, and operators for full-text
    search, which are described in <xref linkend="textsearch"/>.
   </para>

   <table id="functions-string-other">
    <title>Other String Functions and Operators</title>
    <tgroup cols="1">
     <thead>
      <row>
       <entry role="func_table_entry"><para role="func_signature">
        Function/Operator
       </para>
       <para>
        Description
       </para>
       <para>
        Example(s)
       </para></entry>
      </row>
     </thead>

     <tbody>
      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>character string</primary>
         <secondary>prefix

Title: PostgreSQL String Functions: trim, unicode_assigned, upper, and other string functions
Summary
This section continues detailing string functions in PostgreSQL, covering variations of the `trim` function, `unicode_assigned` which checks if all characters in a string are assigned Unicode code points, and `upper` which converts a string to uppercase based on the database locale. It also mentions other string manipulation functions, pattern-matching operators, and full-text search functionalities available in PostgreSQL.