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 more pg_attribute_counted_by() to various flexible array mem
Date: Mon, 02 Nov 2026 10:44:41 +0000
Message-ID: <E1xNpWr-00000001mSk-2uEO@gemulon.postgresql.org> (raw)

Add more pg_attribute_counted_by() to various flexible array members

Annotate flexible array members whose element count is held by another
member of the same struct, so that the compiler knows the real extent
of these arrays.

This continues the work from commit 7a04cac0c3b.  In one case, the
order of assignments to the counted and counting fields had to be
adjusted.

Extension code could in theory be affected by the new annotations in
the header files, but it is mostly unlikely that extensions would
build or resize these structs themselves, and in any case a violation
would show up as a new warning or sanitizer failure, not silent
breakage.

Author: Tristan Partin <tristan@partin.io>
Reviewed-by: Japin Li <japinli@hotmail.com>
Reviewed-by: Greg Burd <greg@burd.me>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/DKBEBF32QLUA.3L2DJRPUYNKHZ%40partin.io

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/633dee1bd1b41145f81619423d573754c7ad2b9e

Modified Files
--------------
src/backend/executor/execParallel.c              |  2 +-
src/backend/nodes/bitmapset.c                    |  4 ++--
src/include/access/brin_internal.h               |  2 +-
src/include/access/tupdesc.h                     |  2 +-
src/include/executor/execPartition.h             |  4 ++--
src/include/executor/instrument.h                |  2 +-
src/include/executor/instrument_node.h           | 20 ++++++++++----------
src/include/jit/jit.h                            |  2 +-
src/include/nodes/bitmapset.h                    |  2 +-
src/include/regex/regguts.h                      |  4 ++--
src/include/statistics/extended_stats_internal.h |  2 +-
src/include/statistics/statistics.h              |  8 ++++----
src/include/tsearch/dicts/spell.h                |  2 +-
src/include/utils/catcache.h                     |  2 +-
src/include/utils/datetime.h                     |  2 +-
src/pl/plpython/plpy_procedure.h                 |  2 +-
16 files changed, 31 insertions(+), 31 deletions(-)



Message-ID: <E1xNpWr-00000001mSk-2uEO@gemulon.postgresql.org>
Permalink:  ../E1xNpWr-00000001mSk-2uEO@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xNpWr-00000001mSk-2uEO@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 more pg_attribute_counted_by() to various flexible array mem
  In-Reply-To: <E1xNpWr-00000001mSk-2uEO@gemulon.postgresql.org>
  References: <E1xNpWr-00000001mSk-2uEO@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