@@ -3508,54 +3508,6 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
3508
3508
</para></entry>
3509
3509
</row>
3510
3510
3511
- <row>
3512
- <entry role="func_table_entry"><para role="func_signature">
3513
- <indexterm>
3514
- <primary>strpos</primary>
3515
- </indexterm>
3516
- <function>strpos</function> ( <parameter>string</parameter> <type>text</type>, <parameter>substring</parameter> <type>text</type> )
3517
- <returnvalue>integer</returnvalue>
3518
- </para>
3519
- <para>
3520
- Returns first starting index of the specified <parameter>substring</parameter>
3521
- within <parameter>string</parameter>, or zero if it's not present.
3522
- (Same as <literal>position(<parameter>substring</parameter> in
3523
- <parameter>string</parameter>)</literal>, but note the reversed
3524
- argument order.)
3525
- </para>
3526
- <para>
3527
- <literal>strpos('high', 'ig')</literal>
3528
- <returnvalue>2</returnvalue>
3529
- </para></entry>
3530
- </row>
3531
-
3532
- <row>
3533
- <entry role="func_table_entry"><para role="func_signature">
3534
- <indexterm>
3535
- <primary>substr</primary>
3536
- </indexterm>
3537
- <function>substr</function> ( <parameter>string</parameter> <type>text</type>, <parameter>start</parameter> <type>integer</type> <optional>, <parameter>count</parameter> <type>integer</type> </optional> )
3538
- <returnvalue>text</returnvalue>
3539
- </para>
3540
- <para>
3541
- Extracts the substring of <parameter>string</parameter> starting at
3542
- the <parameter>start</parameter>'th character,
3543
- and extending for <parameter>count</parameter> characters if that is
3544
- specified. (Same
3545
- as <literal>substring(<parameter>string</parameter>
3546
- from <parameter>start</parameter>
3547
- for <parameter>count</parameter>)</literal>.)
3548
- </para>
3549
- <para>
3550
- <literal>substr('alphabet', 3)</literal>
3551
- <returnvalue>phabet</returnvalue>
3552
- </para>
3553
- <para>
3554
- <literal>substr('alphabet', 3, 2)</literal>
3555
- <returnvalue>ph</returnvalue>
3556
- </para></entry>
3557
- </row>
3558
-
3559
3511
<row>
3560
3512
<entry role="func_table_entry"><para role="func_signature">
3561
3513
<indexterm>
@@ -3576,7 +3528,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
3576
3528
3577
3529
<row>
3578
3530
<entry role="func_table_entry"><para role="func_signature">
3579
- <indexterm>
3531
+ <indexterm id="function-string-to-array" >
3580
3532
<primary>string_to_array</primary>
3581
3533
</indexterm>
3582
3534
<function>string_to_array</function> ( <parameter>string</parameter> <type>text</type>, <parameter>delimiter</parameter> <type>text</type> <optional>, <parameter>null_string</parameter> <type>text</type> </optional> )
@@ -3594,6 +3546,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
3594
3546
If <parameter>null_string</parameter> is supplied and is
3595
3547
not <literal>NULL</literal>, fields matching that string are
3596
3548
replaced by <literal>NULL</literal>.
3549
+ See also <link linkend="function-array-to-string"><function>array_to_string</function></link>.
3597
3550
</para>
3598
3551
<para>
3599
3552
<literal>string_to_array('xx~~yy~~zz', '~~', 'yy')</literal>
@@ -3633,6 +3586,54 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
3633
3586
</para></entry>
3634
3587
</row>
3635
3588
3589
+ <row>
3590
+ <entry role="func_table_entry"><para role="func_signature">
3591
+ <indexterm>
3592
+ <primary>strpos</primary>
3593
+ </indexterm>
3594
+ <function>strpos</function> ( <parameter>string</parameter> <type>text</type>, <parameter>substring</parameter> <type>text</type> )
3595
+ <returnvalue>integer</returnvalue>
3596
+ </para>
3597
+ <para>
3598
+ Returns first starting index of the specified <parameter>substring</parameter>
3599
+ within <parameter>string</parameter>, or zero if it's not present.
3600
+ (Same as <literal>position(<parameter>substring</parameter> in
3601
+ <parameter>string</parameter>)</literal>, but note the reversed
3602
+ argument order.)
3603
+ </para>
3604
+ <para>
3605
+ <literal>strpos('high', 'ig')</literal>
3606
+ <returnvalue>2</returnvalue>
3607
+ </para></entry>
3608
+ </row>
3609
+
3610
+ <row>
3611
+ <entry role="func_table_entry"><para role="func_signature">
3612
+ <indexterm>
3613
+ <primary>substr</primary>
3614
+ </indexterm>
3615
+ <function>substr</function> ( <parameter>string</parameter> <type>text</type>, <parameter>start</parameter> <type>integer</type> <optional>, <parameter>count</parameter> <type>integer</type> </optional> )
3616
+ <returnvalue>text</returnvalue>
3617
+ </para>
3618
+ <para>
3619
+ Extracts the substring of <parameter>string</parameter> starting at
3620
+ the <parameter>start</parameter>'th character,
3621
+ and extending for <parameter>count</parameter> characters if that is
3622
+ specified. (Same
3623
+ as <literal>substring(<parameter>string</parameter>
3624
+ from <parameter>start</parameter>
3625
+ for <parameter>count</parameter>)</literal>.)
3626
+ </para>
3627
+ <para>
3628
+ <literal>substr('alphabet', 3)</literal>
3629
+ <returnvalue>phabet</returnvalue>
3630
+ </para>
3631
+ <para>
3632
+ <literal>substr('alphabet', 3, 2)</literal>
3633
+ <returnvalue>ph</returnvalue>
3634
+ </para></entry>
3635
+ </row>
3636
+
3636
3637
<row>
3637
3638
<entry role="func_table_entry"><para role="func_signature">
3638
3639
<indexterm>
@@ -18452,7 +18453,7 @@ SELECT NULLIF(value, '(none)') ...
18452
18453
18453
18454
<row>
18454
18455
<entry role="func_table_entry"><para role="func_signature">
18455
- <indexterm>
18456
+ <indexterm id="function-array-to-string" >
18456
18457
<primary>array_to_string</primary>
18457
18458
</indexterm>
18458
18459
<function>array_to_string</function> ( <parameter>array</parameter> <type>anyarray</type>, <parameter>delimiter</parameter> <type>text</type> <optional>, <parameter>null_string</parameter> <type>text</type> </optional> )
@@ -18465,6 +18466,7 @@ SELECT NULLIF(value, '(none)') ...
18465
18466
If <parameter>null_string</parameter> is given and is
18466
18467
not <literal>NULL</literal>, then <literal>NULL</literal> array
18467
18468
entries are represented by that string; otherwise, they are omitted.
18469
+ See also <link linkend="function-string-to-array"><function>string_to_array</function></link>.
18468
18470
</para>
18469
18471
<para>
18470
18472
<literal>array_to_string(ARRAY[1, 2, 3, NULL, 5], ',', '*')</literal>
@@ -18584,18 +18586,6 @@ SELECT NULLIF(value, '(none)') ...
18584
18586
</tgroup>
18585
18587
</table>
18586
18588
18587
- <note>
18588
- <para>
18589
- There are two differences in the behavior of <function>string_to_array</function>
18590
- from pre-9.1 versions of <productname>PostgreSQL</productname>.
18591
- First, it will return an empty (zero-element) array rather
18592
- than <literal>NULL</literal> when the input string is of zero length.
18593
- Second, if the delimiter string is <literal>NULL</literal>, the function
18594
- splits the input into individual characters, rather than
18595
- returning <literal>NULL</literal> as before.
18596
- </para>
18597
- </note>
18598
-
18599
18589
<para>
18600
18590
See also <xref linkend="functions-aggregate"/> about the aggregate
18601
18591
function <function>array_agg</function> for use with arrays.
0 commit comments