Remove Item type
authorPeter Eisentraut <[email protected]>
Mon, 27 Oct 2025 08:54:16 +0000 (09:54 +0100)
committerPeter Eisentraut <[email protected]>
Mon, 27 Oct 2025 08:55:59 +0000 (09:55 +0100)
commit76acf4b722faa2a552f62034b793c2797909f91b
tree43ddf923e05c8cfa56097d5634f5f2d4c1d8015c
parent64d2b0968ea494cb11900ffb7681b5784e4112b9
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 <[email protected]>
Reviewed-by: Peter Geoghegan <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/c75cccf5-5709-407b-a36a-2ae6570be766@eisentraut.org
29 files changed:
src/backend/access/brin/brin_pageops.c
src/backend/access/brin/brin_xlog.c
src/backend/access/gin/ginentrypage.c
src/backend/access/gin/ginfast.c
src/backend/access/gin/ginvacuum.c
src/backend/access/gin/ginxlog.c
src/backend/access/gist/gist.c
src/backend/access/gist/gistbuild.c
src/backend/access/gist/gistutil.c
src/backend/access/gist/gistxlog.c
src/backend/access/hash/hash_xlog.c
src/backend/access/hash/hashinsert.c
src/backend/access/heap/heapam_xlog.c
src/backend/access/heap/hio.c
src/backend/access/heap/rewriteheap.c
src/backend/access/nbtree/nbtdedup.c
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtpage.c
src/backend/access/nbtree/nbtsort.c
src/backend/access/nbtree/nbtxlog.c
src/backend/access/spgist/spgdoinsert.c
src/backend/access/spgist/spgutils.c
src/backend/access/spgist/spgxlog.c
src/backend/commands/sequence.c
src/backend/storage/page/bufpage.c
src/include/access/spgist_private.h
src/include/storage/bufpage.h
src/include/storage/item.h [deleted file]
src/tools/pgindent/typedefs.list