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: Mark commented out code as unused
Date: Thu, 22 Jan 2026 11:51:12 +0000
Message-ID: <E1vitDT-001zEx-1q@gemulon.postgresql.org> (raw)

Mark commented out code as unused

There were many PG_GETARG_* calls, mostly around gin, gist, spgist
code, that were commented out, presumably to indicate that the
argument was unused and to indicate that it wasn't forgotten or
miscounted.  But keeping commented-out code updated with refactorings
and style changes is annoying.  So this commit changes them to

    #ifdef NOT_USED

blocks, which is a style already in use.  That way, at least the
indentation and syntax highlighting works correctly, making some of
these blocks much easier to read.

An alternative would be to just delete that code, but there is some
value in making unused arguments explicit, and some of this arguably
serves as example code for index AM APIs.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: David Geier <geidav.pg@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/328e4371-9a4c-4196-9df9-1f23afc900df%40eisentraut.org

Branch
------
master

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

Modified Files
--------------
contrib/btree_gist/btree_bit.c                     |  5 ++--
contrib/btree_gist/btree_bool.c                    |  5 ++--
contrib/btree_gist/btree_bytea.c                   |  5 ++--
contrib/btree_gist/btree_cash.c                    | 10 ++++---
contrib/btree_gist/btree_date.c                    | 10 ++++---
contrib/btree_gist/btree_enum.c                    |  5 ++--
contrib/btree_gist/btree_float4.c                  | 10 ++++---
contrib/btree_gist/btree_float8.c                  | 10 ++++---
contrib/btree_gist/btree_inet.c                    |  5 ++--
contrib/btree_gist/btree_int2.c                    | 10 ++++---
contrib/btree_gist/btree_int4.c                    | 10 ++++---
contrib/btree_gist/btree_int8.c                    | 10 ++++---
contrib/btree_gist/btree_interval.c                | 10 ++++---
contrib/btree_gist/btree_macaddr.c                 |  5 ++--
contrib/btree_gist/btree_macaddr8.c                |  5 ++--
contrib/btree_gist/btree_numeric.c                 |  5 ++--
contrib/btree_gist/btree_oid.c                     | 10 ++++---
contrib/btree_gist/btree_text.c                    | 10 ++++---
contrib/btree_gist/btree_time.c                    | 15 ++++++----
contrib/btree_gist/btree_ts.c                      | 20 ++++++++-----
contrib/btree_gist/btree_uuid.c                    |  5 ++--
contrib/cube/cube.c                                |  5 ++--
contrib/hstore/hstore_gin.c                        | 10 ++++---
contrib/hstore/hstore_gist.c                       |  5 ++--
contrib/intarray/_int_gin.c                        |  5 ++--
contrib/intarray/_int_gist.c                       |  5 ++--
contrib/intarray/_intbig_gist.c                    |  5 ++--
contrib/ltree/_ltree_gist.c                        |  5 ++--
contrib/ltree/ltree_gist.c                         |  5 ++--
contrib/pg_trgm/trgm_gin.c                         | 20 ++++++++-----
contrib/pg_trgm/trgm_gist.c                        | 10 ++++---
contrib/seg/seg.c                                  |  5 ++--
doc/src/sgml/gist.sgml                             | 10 +++++--
src/backend/access/gin/ginarrayproc.c              | 34 +++++++++++++---------
src/backend/access/gist/gistproc.c                 | 32 +++++++++++---------
src/backend/access/spgist/spgkdtreeproc.c          |  4 ++-
src/backend/access/spgist/spgquadtreeproc.c        |  4 ++-
src/backend/access/spgist/spgtextproc.c            |  4 ++-
src/backend/utils/adt/datum.c                      |  4 ++-
src/backend/utils/adt/jsonb_gin.c                  | 20 ++++++++-----
src/backend/utils/adt/network_gist.c               |  5 ++--
src/backend/utils/adt/network_spgist.c             |  4 ++-
src/backend/utils/adt/rangetypes_spgist.c          |  4 ++-
src/backend/utils/adt/tsginidx.c                   | 30 +++++++++++--------
src/backend/utils/adt/tsgistidx.c                  |  7 +++--
src/backend/utils/adt/tsquery_gist.c               |  5 ++--
src/backend/utils/adt/varlena.c                    |  4 ++-
src/test/modules/spgist_name_ops/spgist_name_ops.c |  4 ++-
48 files changed, 266 insertions(+), 169 deletions(-)



Message-ID: <E1vitDT-001zEx-1q@gemulon.postgresql.org>
Permalink:  ../E1vitDT-001zEx-1q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vitDT-001zEx-1q@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Mark commented out code as unused
  In-Reply-To: <E1vitDT-001zEx-1q@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