Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nxAkO-0007qr-B5 for pgsql-docs@arkaria.postgresql.org; Fri, 03 Jun 2022 17:06:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nxAkN-0005Hd-36 for pgsql-docs@arkaria.postgresql.org; Fri, 03 Jun 2022 17:06:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nxAkM-0005HT-Rg for pgsql-docs@lists.postgresql.org; Fri, 03 Jun 2022 17:06:02 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nxAkK-0005Ch-Df for pgsql-docs@lists.postgresql.org; Fri, 03 Jun 2022 17:06:02 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id C5F4D2EB5BD3 for ; Fri, 3 Jun 2022 19:05:58 +0200 (CEST) Received: from s645.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id B6B002E2B43A; Fri, 3 Jun 2022 19:05:58 +0200 (CEST) Received: from s470.loopia.se (unknown [172.22.191.5]) by s645.loopia.se (Postfix) with ESMTP id A6F93156EB8C; Fri, 3 Jun 2022 19:05:58 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1] autolearn=disabled Received: from s934.loopia.se ([172.22.191.5]) by s470.loopia.se (s470.loopia.se [172.22.190.10]) (amavisd-new, port 10024) with LMTP id dILUBhgVsvIs; Fri, 3 Jun 2022 19:05:58 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from smtpclient.apple (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s934.loopia.se (Postfix) with ESMTPSA id EAFF37CEEFB; Fri, 3 Jun 2022 19:05:57 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: Proposal to improve uniq function documentation in intarray extension From: Daniel Gustafsson In-Reply-To: <219445.1654270461@sss.pgh.pa.us> Date: Fri, 3 Jun 2022 19:05:57 +0200 Cc: martin.kalcher@aboutsource.net, pgsql-docs@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <165407884456.573551.8779012279828726162@wrigleys.postgresql.org> <219445.1654270461@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3696.100.31) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 3 Jun 2022, at 17:34, Tom Lane wrote: > .. there's no longer any reason we have > to limit ourselves to one example. I propose this: >=20 > 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 @@ > > > Removes adjacent duplicates. > + Often used with sort to remove all = duplicates. > + > + > + uniq('{1,2,2,3,1,1}'::integer[]) > + {1,2,3,1} > > > uniq(sort('{1,2,3,2,1}'::integer[])) +1 -- Daniel Gustafsson https://vmware.com/