Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0
    • Component/s: Function/UDF
    • Labels:
      None

      Description

      Function Definition

      text substr(string text, from int4 [, count int4])
      

      Description

      • It extracts substring (same as substring(string from from for count)).
      • If string is null, the result also should be null.
      • Note that from is one based index.
      • from can be negative integer.
      • count can be omitted. If then, all string after from will be returned.
      • count cannot be negative integer.
      • If count is 0, the result should be '' instead of null.

      Example and Sementic

      hyunsik=> select substr('abcdef', 3, 2);
       substr 
      --------
      cd
      
      (1 row)
      
      hyunsik=> select substr('abcdef',3) ;
       substr 
      --------
       cdef
      (1 row)
      
      hyunsik=> select substr('abcdef',1,1) ;
       substr 
      --------
       a
      
      (1 row)
      hyunsik=> select substr('abcdef',0,1) ;
       substr 
      --------
       
      (1 row)
      
      hyunsik=> select substr('abcdef',0,2) ;
       substr 
      --------
       a
      (1 row)
      
      

        Attachments

        1. TAJO-341.patch
          6 kB
          Hyoungjun Kim

          Issue Links

            Activity

              People

              • Assignee:
                hjkim Hyoungjun Kim
                Reporter:
                hyunsik Hyunsik Choi
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: