On 24.11.2025 20:52, Robert Haas wrote:
> On Mon, Nov 24, 2025 at 2:38 PM Tom Lane <[email protected]> wrote:
>> Well, either Peter just ran out of energy or there is actually some
>> notational value in Pointer. If it's the latter, I'd like to know.
>
> I agree that would be nice to know.
>
> Peter's original email seemed to indicate that he was deterred by this
> sort of thing:
>
> Pointer **extra_data = (Pointer **) PG_GETARG_POINTER(4);
>
> If Pointer is merely char *, then this is equivalent to:
>
> char ***extra_data = (char ***) PG_GETARG_POINTER(4);
>
> I believe this is the same extra_data that is documented thus:
I figured the same while doing the change.
> So in other words, it's a pointer to an array of generic pointers. In
> a vacuum, I'd suggest that having three levels of indirection that are
> all semantically different but all denoted by an asterisk in C is
> confusing enough to be a bad idea regardless of the specifics. But
> since we've already crossed that bridge, we'll just need to make the
> best of it. Maybe we could use a more specific typedef here, like
> GinExtraPointer. That would be a lot more greppable than just writing
> Pointer, and every GinExtraPointer would be the same flavor of generic
> pointer, whereas any given Pointer is not necessarily related in any
> semantic way to any other.
I went with your proposal of GinExtraPointer. See attached patch. It's
based on the series of patches from Peter's initial mail. I've included
the removal of the Pointer typedef in the same patch.
--
David Geier
From 78af974bb9b50a7a1ab52e9aa5a4108c82b23f31 Mon Sep 17 00:00:00 2001
From: David Geier <[email protected]>
Date: Mon, 24 Nov 2025 21:16:12 +0100
Subject: [PATCH] Remove uses of Pointer in GIN related code
---
contrib/amcheck/verify_gin.c | 2 +-
contrib/btree_gin/btree_gin.c | 7 ++++---
contrib/hstore/hstore_gin.c | 2 +-
contrib/intarray/_int_gin.c | 2 +-
contrib/pg_trgm/trgm_gin.c | 10 +++++-----
doc/src/sgml/gin.sgml | 8 ++++----
src/backend/access/gin/ginarrayproc.c | 6 +++---
src/backend/access/gin/ginentrypage.c | 6 +++---
src/backend/access/gin/ginscan.c | 8 ++++----
src/backend/utils/adt/jsonb_gin.c | 16 ++++++++--------
src/backend/utils/adt/selfuncs.c | 2 +-
src/backend/utils/adt/tsginidx.c | 12 ++++++------
src/include/access/gin.h | 2 ++
src/include/access/gin_private.h | 6 +++---
src/include/access/ginblock.h | 2 +-
src/include/c.h | 7 -------
16 files changed, 47 insertions(+), 51 deletions(-)
diff --git a/contrib/amcheck/verify_gin.c b/contrib/amcheck/verify_gin.c
index 5c3eb4d0fd4..4dc8af4e403 100644
--- a/contrib/amcheck/verify_gin.c
+++ b/contrib/amcheck/verify_gin.c
@@ -98,7 +98,7 @@ gin_index_check(PG_FUNCTION_ARGS)
static ItemPointer
ginReadTupleWithoutState(IndexTuple itup, int *nitems)
{
- Pointer ptr = GinGetPosting(itup);
+ void * ptr = GinGetPosting(itup);
int nipd = GinGetNPosting(itup);
ItemPointer ipd;
int ndecoded;
diff --git a/contrib/btree_gin/btree_gin.c b/contrib/btree_gin/btree_gin.c
index 8c477d17e22..4725f4c1787 100644
--- a/contrib/btree_gin/btree_gin.c
+++ b/contrib/btree_gin/btree_gin.c
@@ -5,6 +5,7 @@
#include <limits.h>
+#include "access/gin.h"
#include "access/stratnum.h"
#include "mb/pg_wchar.h"
#include "utils/builtins.h"
@@ -73,7 +74,7 @@ gin_btree_extract_query(FunctionCallInfo fcinfo,
int32 *nentries = (int32 *) PG_GETARG_POINTER(1);
StrategyNumber strategy = PG_GETARG_UINT16(2);
bool **partialmatch = (bool **) PG_GETARG_POINTER(3);
- Pointer **extra_data = (Pointer **) PG_GETARG_POINTER(4);
+ GinExtraPointer **extra_data = (GinExtraPointer **) PG_GETARG_POINTER(4);
Datum *entries = (Datum *) palloc(sizeof(Datum));
QueryInfo *data = (QueryInfo *) palloc(sizeof(QueryInfo));
bool *ptr_partialmatch = (bool *) palloc(sizeof(bool));
@@ -139,8 +140,8 @@ gin_btree_extract_query(FunctionCallInfo fcinfo,
data->orig_datum = datum;
data->entry_datum = entries[0];
data->typecmp = cmp_fns[rhs_code];
- *extra_data = (Pointer *) palloc(sizeof(Pointer));
- **extra_data = (Pointer) data;
+ *extra_data = (GinExtraPointer *) palloc(sizeof(GinExtraPointer));
+ **extra_data = (GinExtraPointer) data;
PG_RETURN_POINTER(entries);
}
diff --git a/contrib/hstore/hstore_gin.c b/contrib/hstore/hstore_gin.c
index 2e5fa115924..09ff2dd0d99 100644
--- a/contrib/hstore/hstore_gin.c
+++ b/contrib/hstore/hstore_gin.c
@@ -156,7 +156,7 @@ gin_consistent_hstore(PG_FUNCTION_ARGS)
/* HStore *query = PG_GETARG_HSTORE_P(2); */
int32 nkeys = PG_GETARG_INT32(3);
- /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
+ /* GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4); */
bool *recheck = (bool *) PG_GETARG_POINTER(5);
bool res = true;
int32 i;
diff --git a/contrib/intarray/_int_gin.c b/contrib/intarray/_int_gin.c
index b7958d8eca5..ab15d69084e 100644
--- a/contrib/intarray/_int_gin.c
+++ b/contrib/intarray/_int_gin.c
@@ -113,7 +113,7 @@ ginint4_consistent(PG_FUNCTION_ARGS)
StrategyNumber strategy = PG_GETARG_UINT16(1);
int32 nkeys = PG_GETARG_INT32(3);
- /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
+ /* GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4); */
bool *recheck = (bool *) PG_GETARG_POINTER(5);
bool res = false;
int32 i;
diff --git a/contrib/pg_trgm/trgm_gin.c b/contrib/pg_trgm/trgm_gin.c
index 29a52eac7af..5e45cefac26 100644
--- a/contrib/pg_trgm/trgm_gin.c
+++ b/contrib/pg_trgm/trgm_gin.c
@@ -74,7 +74,7 @@ gin_extract_query_trgm(PG_FUNCTION_ARGS)
StrategyNumber strategy = PG_GETARG_UINT16(2);
/* bool **pmatch = (bool **) PG_GETARG_POINTER(3); */
- Pointer **extra_data = (Pointer **) PG_GETARG_POINTER(4);
+ GinExtraPointer **extra_data = (GinExtraPointer **) PG_GETARG_POINTER(4);
/* bool **nullFlags = (bool **) PG_GETARG_POINTER(5); */
int32 *searchMode = (int32 *) PG_GETARG_POINTER(6);
@@ -123,9 +123,9 @@ gin_extract_query_trgm(PG_FUNCTION_ARGS)
* Pointers, but we just put the same value in each element.
*/
trglen = ARRNELEM(trg);
- *extra_data = (Pointer *) palloc(sizeof(Pointer) * trglen);
+ *extra_data = (GinExtraPointer *) palloc(sizeof(GinExtraPointer) * trglen);
for (i = 0; i < trglen; i++)
- (*extra_data)[i] = (Pointer) graph;
+ (*extra_data)[i] = (GinExtraPointer) graph;
}
else
{
@@ -174,7 +174,7 @@ gin_trgm_consistent(PG_FUNCTION_ARGS)
/* text *query = PG_GETARG_TEXT_PP(2); */
int32 nkeys = PG_GETARG_INT32(3);
- Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
+ GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4);
bool *recheck = (bool *) PG_GETARG_POINTER(5);
bool res;
int32 i,
@@ -273,7 +273,7 @@ gin_trgm_triconsistent(PG_FUNCTION_ARGS)
/* text *query = PG_GETARG_TEXT_PP(2); */
int32 nkeys = PG_GETARG_INT32(3);
- Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
+ GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4);
GinTernaryValue res = GIN_MAYBE;
int32 i,
ntrue;
diff --git a/doc/src/sgml/gin.sgml b/doc/src/sgml/gin.sgml
index 82410b1fbdf..bd392bcfdfd 100644
--- a/doc/src/sgml/gin.sgml
+++ b/doc/src/sgml/gin.sgml
@@ -184,7 +184,7 @@
<varlistentry>
<term><function>Datum *extractQuery(Datum query, int32 *nkeys,
- StrategyNumber n, bool **pmatch, Pointer **extra_data,
+ StrategyNumber n, bool **pmatch, GinExtraPointer **extra_data,
bool **nullFlags, int32 *searchMode)</function></term>
<listitem>
<para>
@@ -273,7 +273,7 @@
<variablelist>
<varlistentry>
<term><function>bool consistent(bool check[], StrategyNumber n, Datum query,
- int32 nkeys, Pointer extra_data[], bool *recheck,
+ int32 nkeys, GinExtraPointer extra_data[], bool *recheck,
Datum queryKeys[], bool nullFlags[])</function></term>
<listitem>
<para>
@@ -324,7 +324,7 @@
<varlistentry>
<term><function>GinTernaryValue triConsistent(GinTernaryValue check[], StrategyNumber n, Datum query,
- int32 nkeys, Pointer extra_data[],
+ int32 nkeys, GinExtraPointer extra_data[],
Datum queryKeys[], bool nullFlags[])</function></term>
<listitem>
<para>
@@ -391,7 +391,7 @@
<variablelist>
<varlistentry>
<term><function>int comparePartial(Datum partial_key, Datum key, StrategyNumber n,
- Pointer extra_data)</function></term>
+ GinExtraPointer extra_data)</function></term>
<listitem>
<para>
Compare a partial-match query key to an index key.
diff --git a/src/backend/access/gin/ginarrayproc.c b/src/backend/access/gin/ginarrayproc.c
index 1f821323eb0..46d9c29a08b 100644
--- a/src/backend/access/gin/ginarrayproc.c
+++ b/src/backend/access/gin/ginarrayproc.c
@@ -84,7 +84,7 @@ ginqueryarrayextract(PG_FUNCTION_ARGS)
StrategyNumber strategy = PG_GETARG_UINT16(2);
/* bool **pmatch = (bool **) PG_GETARG_POINTER(3); */
- /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
+ /* GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4); */
bool **nullFlags = (bool **) PG_GETARG_POINTER(5);
int32 *searchMode = (int32 *) PG_GETARG_POINTER(6);
int16 elmlen;
@@ -147,7 +147,7 @@ ginarrayconsistent(PG_FUNCTION_ARGS)
/* ArrayType *query = PG_GETARG_ARRAYTYPE_P(2); */
int32 nkeys = PG_GETARG_INT32(3);
- /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
+ /* GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4); */
bool *recheck = (bool *) PG_GETARG_POINTER(5);
/* Datum *queryKeys = (Datum *) PG_GETARG_POINTER(6); */
@@ -231,7 +231,7 @@ ginarraytriconsistent(PG_FUNCTION_ARGS)
/* ArrayType *query = PG_GETARG_ARRAYTYPE_P(2); */
int32 nkeys = PG_GETARG_INT32(3);
- /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
+ /* GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4); */
/* Datum *queryKeys = (Datum *) PG_GETARG_POINTER(5); */
bool *nullFlags = (bool *) PG_GETARG_POINTER(6);
GinTernaryValue res;
diff --git a/src/backend/access/gin/ginentrypage.c b/src/backend/access/gin/ginentrypage.c
index c0592367700..0764da28c57 100644
--- a/src/backend/access/gin/ginentrypage.c
+++ b/src/backend/access/gin/ginentrypage.c
@@ -43,7 +43,7 @@ static void entrySplitPage(GinBtree btree, Buffer origbuf,
IndexTuple
GinFormTuple(GinState *ginstate,
OffsetNumber attnum, Datum key, GinNullCategory category,
- Pointer data, Size dataSize, int nipd,
+ const void *data, Size dataSize, int nipd,
bool errorTooBig)
{
Datum datums[2];
@@ -136,7 +136,7 @@ GinFormTuple(GinState *ginstate,
*/
if (data)
{
- char *ptr = GinGetPosting(itup);
+ void *ptr = GinGetPosting(itup);
memcpy(ptr, data, dataSize);
}
@@ -162,7 +162,7 @@ ItemPointer
ginReadTuple(GinState *ginstate, OffsetNumber attnum, IndexTuple itup,
int *nitems)
{
- Pointer ptr = GinGetPosting(itup);
+ void * ptr = GinGetPosting(itup);
int nipd = GinGetNPosting(itup);
ItemPointer ipd;
int ndecoded;
diff --git a/src/backend/access/gin/ginscan.c b/src/backend/access/gin/ginscan.c
index 26081693383..932badfd648 100644
--- a/src/backend/access/gin/ginscan.c
+++ b/src/backend/access/gin/ginscan.c
@@ -57,7 +57,7 @@ static GinScanEntry
ginFillScanEntry(GinScanOpaque so, OffsetNumber attnum,
StrategyNumber strategy, int32 searchMode,
Datum queryKey, GinNullCategory queryCategory,
- bool isPartialMatch, Pointer extra_data)
+ bool isPartialMatch, GinExtraPointer extra_data)
{
GinState *ginstate = &so->ginstate;
GinScanEntry scanEntry;
@@ -160,7 +160,7 @@ ginFillScanKey(GinScanOpaque so, OffsetNumber attnum,
StrategyNumber strategy, int32 searchMode,
Datum query, uint32 nQueryValues,
Datum *queryValues, GinNullCategory *queryCategories,
- bool *partial_matches, Pointer *extra_data)
+ bool *partial_matches, GinExtraPointer *extra_data)
{
GinScanKey key = &(so->keys[so->nkeys++]);
GinState *ginstate = &so->ginstate;
@@ -206,7 +206,7 @@ ginFillScanKey(GinScanOpaque so, OffsetNumber attnum,
Datum queryKey;
GinNullCategory queryCategory;
bool isPartialMatch;
- Pointer this_extra;
+ GinExtraPointer this_extra;
queryKey = queryValues[i];
queryCategory = queryCategories[i];
@@ -302,7 +302,7 @@ ginNewScanKey(IndexScanDesc scan)
Datum *queryValues;
int32 nQueryValues = 0;
bool *partial_matches = NULL;
- Pointer *extra_data = NULL;
+ GinExtraPointer *extra_data = NULL;
bool *nullFlags = NULL;
GinNullCategory *categories;
int32 searchMode = GIN_SEARCH_MODE_DEFAULT;
diff --git a/src/backend/utils/adt/jsonb_gin.c b/src/backend/utils/adt/jsonb_gin.c
index 9b56248cf0b..16ddccaada6 100644
--- a/src/backend/utils/adt/jsonb_gin.c
+++ b/src/backend/utils/adt/jsonb_gin.c
@@ -746,7 +746,7 @@ emit_jsp_gin_entries(JsonPathGinNode *node, GinEntries *entries)
*/
static Datum *
extract_jsp_query(JsonPath *jp, StrategyNumber strat, bool pathOps,
- int32 *nentries, Pointer **extra_data)
+ int32 *nentries, GinExtraPointer **extra_data)
{
JsonPathGinContext cxt;
JsonPathItem root;
@@ -786,7 +786,7 @@ extract_jsp_query(JsonPath *jp, StrategyNumber strat, bool pathOps,
return NULL;
*extra_data = palloc0(sizeof(**extra_data) * entries.count);
- **extra_data = (Pointer) node;
+ **extra_data = (GinExtraPointer) node;
return entries.buf;
}
@@ -909,7 +909,7 @@ gin_extract_jsonb_query(PG_FUNCTION_ARGS)
strategy == JsonbJsonpathExistsStrategyNumber)
{
JsonPath *jp = PG_GETARG_JSONPATH_P(0);
- Pointer **extra_data = (Pointer **) PG_GETARG_POINTER(4);
+ GinExtraPointer **extra_data = (GinExtraPointer **) PG_GETARG_POINTER(4);
entries = extract_jsp_query(jp, strategy, false, nentries, extra_data);
@@ -934,7 +934,7 @@ gin_consistent_jsonb(PG_FUNCTION_ARGS)
/* Jsonb *query = PG_GETARG_JSONB_P(2); */
int32 nkeys = PG_GETARG_INT32(3);
- Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
+ GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4);
bool *recheck = (bool *) PG_GETARG_POINTER(5);
bool res = true;
int32 i;
@@ -1017,7 +1017,7 @@ gin_triconsistent_jsonb(PG_FUNCTION_ARGS)
/* Jsonb *query = PG_GETARG_JSONB_P(2); */
int32 nkeys = PG_GETARG_INT32(3);
- Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
+ GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4);
GinTernaryValue res = GIN_MAYBE;
int32 i;
@@ -1200,7 +1200,7 @@ gin_extract_jsonb_query_path(PG_FUNCTION_ARGS)
strategy == JsonbJsonpathExistsStrategyNumber)
{
JsonPath *jp = PG_GETARG_JSONPATH_P(0);
- Pointer **extra_data = (Pointer **) PG_GETARG_POINTER(4);
+ GinExtraPointer **extra_data = (GinExtraPointer **) PG_GETARG_POINTER(4);
entries = extract_jsp_query(jp, strategy, true, nentries, extra_data);
@@ -1224,7 +1224,7 @@ gin_consistent_jsonb_path(PG_FUNCTION_ARGS)
/* Jsonb *query = PG_GETARG_JSONB_P(2); */
int32 nkeys = PG_GETARG_INT32(3);
- Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
+ GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4);
bool *recheck = (bool *) PG_GETARG_POINTER(5);
bool res = true;
int32 i;
@@ -1276,7 +1276,7 @@ gin_triconsistent_jsonb_path(PG_FUNCTION_ARGS)
/* Jsonb *query = PG_GETARG_JSONB_P(2); */
int32 nkeys = PG_GETARG_INT32(3);
- Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
+ GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4);
GinTernaryValue res = GIN_MAYBE;
int32 i;
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 540aa9628d7..90531323066 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -8249,7 +8249,7 @@ gincost_pattern(IndexOptInfo *index, int indexcol,
righttype;
int32 nentries = 0;
bool *partial_matches = NULL;
- Pointer *extra_data = NULL;
+ GinExtraPointer *extra_data = NULL;
bool *nullFlags = NULL;
int32 searchMode = GIN_SEARCH_MODE_DEFAULT;
int32 i;
diff --git a/src/backend/utils/adt/tsginidx.c b/src/backend/utils/adt/tsginidx.c
index 2712fd89df0..e943f4cd968 100644
--- a/src/backend/utils/adt/tsginidx.c
+++ b/src/backend/utils/adt/tsginidx.c
@@ -44,7 +44,7 @@ gin_cmp_prefix(PG_FUNCTION_ARGS)
#ifdef NOT_USED
StrategyNumber strategy = PG_GETARG_UINT16(2);
- Pointer extra_data = PG_GETARG_POINTER(3);
+ GinExtraPointer extra_data = PG_GETARG_POINTER(3);
#endif
int cmp;
@@ -98,7 +98,7 @@ gin_extract_tsquery(PG_FUNCTION_ARGS)
/* StrategyNumber strategy = PG_GETARG_UINT16(2); */
bool **ptr_partialmatch = (bool **) PG_GETARG_POINTER(3);
- Pointer **extra_data = (Pointer **) PG_GETARG_POINTER(4);
+ GinExtraPointer **extra_data = (GinExtraPointer **) PG_GETARG_POINTER(4);
/* bool **nullFlags = (bool **) PG_GETARG_POINTER(5); */
int32 *searchMode = (int32 *) PG_GETARG_POINTER(6);
@@ -141,7 +141,7 @@ gin_extract_tsquery(PG_FUNCTION_ARGS)
* same, entry's) number. Entry's number is used in check array in
* consistent method. We use the same map for each entry.
*/
- *extra_data = (Pointer *) palloc(sizeof(Pointer) * j);
+ *extra_data = (GinExtraPointer *) palloc(sizeof(GinExtraPointer) * j);
map_item_operand = (int *) palloc0(sizeof(int) * query->size);
/* Now rescan the VAL items and fill in the arrays */
@@ -157,7 +157,7 @@ gin_extract_tsquery(PG_FUNCTION_ARGS)
val->length);
entries[j] = PointerGetDatum(txt);
partialmatch[j] = val->prefix;
- (*extra_data)[j] = (Pointer) map_item_operand;
+ (*extra_data)[j] = (GinExtraPointer) map_item_operand;
map_item_operand[i] = j;
j++;
}
@@ -219,7 +219,7 @@ gin_tsquery_consistent(PG_FUNCTION_ARGS)
TSQuery query = PG_GETARG_TSQUERY(2);
/* int32 nkeys = PG_GETARG_INT32(3); */
- Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
+ GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4);
bool *recheck = (bool *) PG_GETARG_POINTER(5);
bool res = false;
@@ -268,7 +268,7 @@ gin_tsquery_triconsistent(PG_FUNCTION_ARGS)
TSQuery query = PG_GETARG_TSQUERY(2);
/* int32 nkeys = PG_GETARG_INT32(3); */
- Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
+ GinExtraPointer *extra_data = (GinExtraPointer *) PG_GETARG_POINTER(4);
GinTernaryValue res = GIN_FALSE;
if (query->size > 0)
diff --git a/src/include/access/gin.h b/src/include/access/gin.h
index 13ea91922ef..fd26166e229 100644
--- a/src/include/access/gin.h
+++ b/src/include/access/gin.h
@@ -70,6 +70,8 @@ typedef struct GinStatsData
*/
typedef char GinTernaryValue;
+typedef void *GinExtraPointer;
+
StaticAssertDecl(sizeof(GinTernaryValue) == sizeof(bool),
"sizes of GinTernaryValue and bool are not equal");
diff --git a/src/include/access/gin_private.h b/src/include/access/gin_private.h
index db19ffd9897..d4f3c524f1f 100644
--- a/src/include/access/gin_private.h
+++ b/src/include/access/gin_private.h
@@ -214,7 +214,7 @@ extern void ginInsertValue(GinBtree btree, GinBtreeStack *stack,
/* ginentrypage.c */
extern IndexTuple GinFormTuple(GinState *ginstate,
OffsetNumber attnum, Datum key, GinNullCategory category,
- Pointer data, Size dataSize, int nipd, bool errorTooBig);
+ const void *data, Size dataSize, int nipd, bool errorTooBig);
extern void ginPrepareEntryScan(GinBtree btree, OffsetNumber attnum,
Datum key, GinNullCategory category,
GinState *ginstate);
@@ -303,7 +303,7 @@ typedef struct GinScanKeyData
/* NB: these three arrays have only nuserentries elements! */
Datum *queryValues;
GinNullCategory *queryCategories;
- Pointer *extra_data;
+ GinExtraPointer *extra_data;
StrategyNumber strategy;
int32 searchMode;
OffsetNumber attnum;
@@ -341,7 +341,7 @@ typedef struct GinScanEntryData
Datum queryKey;
GinNullCategory queryCategory;
bool isPartialMatch;
- Pointer extra_data;
+ GinExtraPointer extra_data;
StrategyNumber strategy;
int32 searchMode;
OffsetNumber attnum;
diff --git a/src/include/access/ginblock.h b/src/include/access/ginblock.h
index 4c1681068db..e7365c220cf 100644
--- a/src/include/access/ginblock.h
+++ b/src/include/access/ginblock.h
@@ -236,7 +236,7 @@ typedef signed char GinNullCategory;
#define GIN_ITUP_COMPRESSED (1U << 31)
#define GinGetPostingOffset(itup) (GinItemPointerGetBlockNumber(&(itup)->t_tid) & (~GIN_ITUP_COMPRESSED))
#define GinSetPostingOffset(itup,n) ItemPointerSetBlockNumber(&(itup)->t_tid,(n)|GIN_ITUP_COMPRESSED)
-#define GinGetPosting(itup) ((Pointer) ((char*)(itup) + GinGetPostingOffset(itup)))
+#define GinGetPosting(itup) ((void *) ((char*)(itup) + GinGetPostingOffset(itup)))
#define GinItupIsCompressed(itup) ((GinItemPointerGetBlockNumber(&(itup)->t_tid) & GIN_ITUP_COMPRESSED) != 0)
/*
diff --git a/src/include/c.h b/src/include/c.h
index ccd2b654d45..7783d07c172 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -524,13 +524,6 @@ typedef void (*pg_funcptr_t) (void);
* ----------------------------------------------------------------
*/
-/*
- * Pointer
- * Variable holding address of any memory resident object.
- * (obsolescent; use void * or char *)
- */
-typedef void *Pointer;
-
/* Historical names for types in <stdint.h>. */
typedef int8_t int8;
typedef int16_t int16;
--
2.51.0