Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4ecacc3

Browse files
committed
Doc: improve example for intarray's uniq() function.
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
1 parent 94c7db4 commit 4ecacc3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/src/sgml/intarray.sgml

+5
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@
131131
</para>
132132
<para>
133133
Removes adjacent duplicates.
134+
Often used with <function>sort</function> to remove all duplicates.
135+
</para>
136+
<para>
137+
<literal>uniq('{1,2,2,3,1,1}'::integer[])</literal>
138+
<returnvalue>{1,2,3,1}</returnvalue>
134139
</para>
135140
<para>
136141
<literal>uniq(sort('{1,2,3,2,1}'::integer[]))</literal>

0 commit comments

Comments
 (0)