diff options
author | Tom Lane | 2022-06-03 17:54:53 +0000 |
---|---|---|
committer | Tom Lane | 2022-06-03 17:54:53 +0000 |
commit | 4ecacc3c8cb4b27374bdb1ca83696c0c09ee7f79 (patch) | |
tree | 6ad502d6fba9e741a413b1ebadd4af8bc653c607 | |
parent | 94c7db4f1dc33f6e393c53cde48775449a593176 (diff) |
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/[email protected]
-rw-r--r-- | doc/src/sgml/intarray.sgml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/src/sgml/intarray.sgml b/doc/src/sgml/intarray.sgml index f930c08eeb..18c6f8c3ba 100644 --- a/doc/src/sgml/intarray.sgml +++ b/doc/src/sgml/intarray.sgml @@ -131,6 +131,11 @@ </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> |