Doc: improve example for intarray's uniq() function.
authorTom Lane <[email protected]>
Fri, 3 Jun 2022 17:54:53 +0000 (13:54 -0400)
committerTom Lane <[email protected]>
Fri, 3 Jun 2022 17:54:53 +0000 (13:54 -0400)
The previous entry invited confusion between what uniq() does
by itself and what it does when combined with sort().  The latter
usage is pretty useful so we should show it, but add an additional
example to clarify the results of uniq() alone.

Per suggestion from Martin Kalcher.  Back-patch to v13, where
we switched to formatting that supports multiple examples.

Discussion: https://postgr.es/m/165407884456.573551.8779012279828726162@wrigleys.postgresql.org

doc/src/sgml/intarray.sgml

index f930c08eeb7897c85cb6aad4704f3584e247ce92..18c6f8c3baec8da0058f335a94575b6021e68de9 100644 (file)
        </para>
        <para>
         Removes adjacent duplicates.
+        Often used with <function>sort</function> to remove all duplicates.
+       </para>
+       <para>
+        <literal>uniq('{1,2,2,3,1,1}'::integer[])</literal>
+        <returnvalue>{1,2,3,1}</returnvalue>
        </para>
        <para>
         <literal>uniq(sort('{1,2,3,2,1}'::integer[]))</literal>