pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add reusable routine for making arrays unique.
Date: Thu, 07 Nov 2019 04:03:28 +0000
Message-ID: <E1iSZ16-000206-Te@gemulon.postgresql.org> (raw)

Add reusable routine for making arrays unique.

Introduce qunique() and qunique_arg(), which can be used after qsort()
and qsort_arg() respectively to remove duplicate values.  Use it where
appropriate.

Author: Thomas Munro
Reviewed-by: Tom Lane (in an earlier version)
Discussion: https://postgr.es/m/CAEepm%3D2vmFTNpAmwbGGD2WaryM6T3hSDVKQPfUwjdD_5XY6vAA%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7815e7efdb4ce9575b5d8460beb0dd2569d7ca3a

Modified Files
--------------
contrib/hstore/hstore_io.c           |  5 +++
contrib/intarray/_int_tool.c         | 19 +++--------
contrib/pg_trgm/trgm_op.c            | 25 ++------------
src/backend/access/nbtree/nbtutils.c | 19 ++---------
src/backend/executor/nodeTidscan.c   | 13 ++------
src/backend/utils/adt/acl.c          | 15 +++------
src/backend/utils/adt/tsgistidx.c    | 29 ++--------------
src/backend/utils/adt/tsquery_op.c   | 29 +++-------------
src/backend/utils/adt/tsvector.c     |  5 +--
src/backend/utils/adt/tsvector_op.c  | 59 +++++---------------------------
src/backend/utils/adt/txid.c         | 19 ++---------
src/backend/utils/cache/syscache.c   | 21 ++++--------
src/include/lib/qunique.h            | 65 ++++++++++++++++++++++++++++++++++++
13 files changed, 115 insertions(+), 208 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1iSZ16-000206-Te@gemulon.postgresql.org>
Permalink:  ../E1iSZ16-000206-Te@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iSZ16-000206-Te@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tmunro@postgresql.org
  Subject: Re: pgsql: Add reusable routine for making arrays unique.
  In-Reply-To: <E1iSZ16-000206-Te@gemulon.postgresql.org>
  References: <E1iSZ16-000206-Te@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox