pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add construct_array_builtin, deconstruct_array_builtin
Date: Fri, 01 Jul 2022 09:40:21 +0000
Message-ID: <E1o7D8N-000f0o-NT@gemulon.postgresql.org> (raw)

Add construct_array_builtin, deconstruct_array_builtin

There were many calls to construct_array() and deconstruct_array() for
built-in types, for example, when dealing with system catalog columns.
These all hardcoded the type attributes necessary to pass to these
functions.

To simplify this a bit, add construct_array_builtin(),
deconstruct_array_builtin() as wrappers that centralize this hardcoded
knowledge.  This simplifies many call sites and reduces the amount of
hardcoded stuff that is spread around.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/2914356f-9e5f-8c59-2995-5997fc48bcba%40enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d746021de18baf0f29eff0388204a0664f41eb8b

Modified Files
--------------
contrib/hstore/hstore_gin.c                      |   4 +-
contrib/hstore/hstore_gist.c                     |   8 +-
contrib/hstore/hstore_io.c                       |  12 +-
contrib/hstore/hstore_op.c                       |  11 +-
contrib/pageinspect/btreefuncs.c                 |   6 +-
contrib/pageinspect/ginfuncs.c                   |  10 +-
contrib/pageinspect/gistfuncs.c                  |   4 +-
contrib/pageinspect/hashfuncs.c                  |  14 +-
contrib/pageinspect/heapfuncs.c                  |   4 +-
contrib/pg_trgm/trgm_op.c                        |   7 +-
contrib/pgcrypto/pgp-pgsql.c                     |   9 +-
src/backend/access/common/reloptions.c           |   9 +-
src/backend/catalog/objectaddress.c              |  12 +-
src/backend/catalog/pg_constraint.c              |  21 +--
src/backend/catalog/pg_proc.c                    |   5 +-
src/backend/catalog/pg_subscription.c            |   4 +-
src/backend/commands/analyze.c                   |   5 +-
src/backend/commands/event_trigger.c             |   3 +-
src/backend/commands/extension.c                 |  24 +---
src/backend/commands/functioncmds.c              |  12 +-
src/backend/commands/policy.c                    |   9 +-
src/backend/commands/prepare.c                   |   4 +-
src/backend/commands/statscmds.c                 |   2 +-
src/backend/commands/subscriptioncmds.c          |   3 +-
src/backend/commands/typecmds.c                  |   7 +-
src/backend/executor/nodeTidscan.c               |   4 +-
src/backend/parser/parse_type.c                  |   4 +-
src/backend/parser/parse_utilcmd.c               |   4 +-
src/backend/replication/logical/logicalfuncs.c   |   3 +-
src/backend/statistics/extended_stats.c          |   5 +-
src/backend/tsearch/dict.c                       |   7 +-
src/backend/utils/adt/arrayfuncs.c               | 161 ++++++++++++++++++++++-
src/backend/utils/adt/arrayutils.c               |   5 +-
src/backend/utils/adt/hbafuncs.c                 |   2 +-
src/backend/utils/adt/json.c                     |  13 +-
src/backend/utils/adt/jsonb.c                    |  13 +-
src/backend/utils/adt/jsonb_gin.c                |   4 +-
src/backend/utils/adt/jsonb_op.c                 |   6 +-
src/backend/utils/adt/jsonfuncs.c                |  18 +--
src/backend/utils/adt/lockfuncs.c                |  10 +-
src/backend/utils/adt/name.c                     |   6 +-
src/backend/utils/adt/orderedsetaggs.c           |  20 ++-
src/backend/utils/adt/pg_upgrade_support.c       |   4 +-
src/backend/utils/adt/ruleutils.c                |  20 ++-
src/backend/utils/adt/tsvector_op.c              |  19 +--
src/backend/utils/adt/xml.c                      |   6 +-
src/backend/utils/cache/evtcache.c               |   3 +-
src/backend/utils/fmgr/funcapi.c                 |  14 +-
src/backend/utils/misc/guc.c                     |  14 +-
src/include/utils/array.h                        |   4 +
src/test/modules/test_rls_hooks/test_rls_hooks.c |   4 +-
51 files changed, 284 insertions(+), 298 deletions(-)



Message-ID: <E1o7D8N-000f0o-NT@gemulon.postgresql.org>
Permalink:  ../E1o7D8N-000f0o-NT@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1o7D8N-000f0o-NT@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: peter@eisentraut.org
  Subject: Re: pgsql: Add construct_array_builtin, deconstruct_array_builtin
  In-Reply-To: <E1o7D8N-000f0o-NT@gemulon.postgresql.org>
  References: <E1o7D8N-000f0o-NT@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