From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove Item type
Date: Mon, 27 Oct 2025 09:19:59 +0000
Message-ID: <E1vDJOR-003j6f-0A@gemulon.postgresql.org> (raw)
Remove Item type
This type is just char * underneath, it provides no real value, no
type safety, and just makes the code one level more mysterious. It is
more idiomatic to refer to blobs of memory by a combination of void *
and size_t, so change it to that.
Also, since this type hides the pointerness, we can't apply qualifiers
to what is pointed to, which requires some unconstify nonsense. This
change allows fixing that.
Extension code that uses the Item type can change its code to use
void * to be backward compatible.
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Peter Geoghegan <pg@bowt.ie>
Discussion: https://www.postgresql.org/message-id/flat/c75cccf5-5709-407b-a36a-2ae6570be766@eisentraut.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/76acf4b722faa2a552f62034b793c2797909f91b
Modified Files
--------------
src/backend/access/brin/brin_pageops.c | 8 +++---
src/backend/access/brin/brin_xlog.c | 4 +--
src/backend/access/gin/ginentrypage.c | 8 +++---
src/backend/access/gin/ginfast.c | 4 +--
src/backend/access/gin/ginvacuum.c | 2 +-
src/backend/access/gin/ginxlog.c | 7 +++--
src/backend/access/gist/gist.c | 5 ++--
src/backend/access/gist/gistbuild.c | 2 +-
src/backend/access/gist/gistutil.c | 2 +-
src/backend/access/gist/gistxlog.c | 4 +--
src/backend/access/hash/hash_xlog.c | 7 +++--
src/backend/access/hash/hashinsert.c | 12 +++------
src/backend/access/heap/heapam_xlog.c | 7 +++--
src/backend/access/heap/hio.c | 4 +--
src/backend/access/heap/rewriteheap.c | 3 +--
src/backend/access/nbtree/nbtdedup.c | 9 +++----
src/backend/access/nbtree/nbtinsert.c | 18 +++++--------
src/backend/access/nbtree/nbtpage.c | 9 +++----
src/backend/access/nbtree/nbtsort.c | 6 ++---
src/backend/access/nbtree/nbtxlog.c | 48 ++++++++++++---------------------
src/backend/access/spgist/spgdoinsert.c | 36 +++++++++++--------------
src/backend/access/spgist/spgutils.c | 2 +-
src/backend/access/spgist/spgxlog.c | 32 +++++++++-------------
src/backend/commands/sequence.c | 6 ++---
src/backend/storage/page/bufpage.c | 4 +--
src/include/access/spgist_private.h | 2 +-
src/include/storage/bufpage.h | 9 +++----
src/include/storage/item.h | 19 -------------
src/tools/pgindent/typedefs.list | 1 -
29 files changed, 102 insertions(+), 178 deletions(-)
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: Remove Item type
In-Reply-To: <E1vDJOR-003j6f-0A@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