Add reusable routine for making arrays unique

Enterprise / PostgreSQL - Thomas Munro [postgresql.org] - 7 November 2019 04:00 EST

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

7815e7efdb Add reusable routine for making arrays unique.
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(-)

Upstream: git.postgresql.org


  • Share