aboutsummaryrefslogtreecommitdiff
path: root/contrib/hstore
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/hstore')
-rw-r--r--contrib/hstore/hstore_gin.c2
-rw-r--r--contrib/hstore/hstore_gist.c4
-rw-r--r--contrib/hstore/hstore_io.c24
-rw-r--r--contrib/hstore/hstore_op.c4
4 files changed, 17 insertions, 17 deletions
diff --git a/contrib/hstore/hstore_gin.c b/contrib/hstore/hstore_gin.c
index 766c00bb6a7..2e5fa115924 100644
--- a/contrib/hstore/hstore_gin.c
+++ b/contrib/hstore/hstore_gin.c
@@ -127,7 +127,7 @@ gin_extract_hstore_query(PG_FUNCTION_ARGS)
/* Nulls in the array are ignored, cf hstoreArrayToPairs */
if (key_nulls[i])
continue;
- item = makeitem(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ, KEYFLAG);
+ item = makeitem(VARDATA(DatumGetPointer(key_datums[i])), VARSIZE(DatumGetPointer(key_datums[i])) - VARHDRSZ, KEYFLAG);
entries[j++] = PointerGetDatum(item);
}
diff --git a/contrib/hstore/hstore_gist.c b/contrib/hstore/hstore_gist.c
index a3b08af3850..69515dc3d3f 100644
--- a/contrib/hstore/hstore_gist.c
+++ b/contrib/hstore/hstore_gist.c
@@ -576,7 +576,7 @@ ghstore_consistent(PG_FUNCTION_ARGS)
if (key_nulls[i])
continue;
- crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ);
+ crc = crc32_sz(VARDATA(DatumGetPointer(key_datums[i])), VARSIZE(DatumGetPointer(key_datums[i])) - VARHDRSZ);
if (!(GETBIT(sign, HASHVAL(crc, siglen))))
res = false;
}
@@ -599,7 +599,7 @@ ghstore_consistent(PG_FUNCTION_ARGS)
if (key_nulls[i])
continue;
- crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ);
+ crc = crc32_sz(VARDATA(DatumGetPointer(key_datums[i])), VARSIZE(DatumGetPointer(key_datums[i])) - VARHDRSZ);
if (GETBIT(sign, HASHVAL(crc, siglen)))
res = true;
}
diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c
index 4f867e4bd1f..9c53877c4a5 100644
--- a/contrib/hstore/hstore_io.c
+++ b/contrib/hstore/hstore_io.c
@@ -684,22 +684,22 @@ hstore_from_arrays(PG_FUNCTION_ARGS)
if (!value_nulls || value_nulls[i])
{
- pairs[i].key = VARDATA(key_datums[i]);
+ pairs[i].key = VARDATA(DatumGetPointer(key_datums[i]));
pairs[i].val = NULL;
pairs[i].keylen =
- hstoreCheckKeyLen(VARSIZE(key_datums[i]) - VARHDRSZ);
+ hstoreCheckKeyLen(VARSIZE(DatumGetPointer(key_datums[i])) - VARHDRSZ);
pairs[i].vallen = 4;
pairs[i].isnull = true;
pairs[i].needfree = false;
}
else
{
- pairs[i].key = VARDATA(key_datums[i]);
- pairs[i].val = VARDATA(value_datums[i]);
+ pairs[i].key = VARDATA(DatumGetPointer(key_datums[i]));
+ pairs[i].val = VARDATA(DatumGetPointer(value_datums[i]));
pairs[i].keylen =
- hstoreCheckKeyLen(VARSIZE(key_datums[i]) - VARHDRSZ);
+ hstoreCheckKeyLen(VARSIZE(DatumGetPointer(key_datums[i])) - VARHDRSZ);
pairs[i].vallen =
- hstoreCheckValLen(VARSIZE(value_datums[i]) - VARHDRSZ);
+ hstoreCheckValLen(VARSIZE(DatumGetPointer(value_datums[i])) - VARHDRSZ);
pairs[i].isnull = false;
pairs[i].needfree = false;
}
@@ -778,22 +778,22 @@ hstore_from_array(PG_FUNCTION_ARGS)
if (in_nulls[i * 2 + 1])
{
- pairs[i].key = VARDATA(in_datums[i * 2]);
+ pairs[i].key = VARDATA(DatumGetPointer(in_datums[i * 2]));
pairs[i].val = NULL;
pairs[i].keylen =
- hstoreCheckKeyLen(VARSIZE(in_datums[i * 2]) - VARHDRSZ);
+ hstoreCheckKeyLen(VARSIZE(DatumGetPointer(in_datums[i * 2])) - VARHDRSZ);
pairs[i].vallen = 4;
pairs[i].isnull = true;
pairs[i].needfree = false;
}
else
{
- pairs[i].key = VARDATA(in_datums[i * 2]);
- pairs[i].val = VARDATA(in_datums[i * 2 + 1]);
+ pairs[i].key = VARDATA(DatumGetPointer(in_datums[i * 2]));
+ pairs[i].val = VARDATA(DatumGetPointer(in_datums[i * 2 + 1]));
pairs[i].keylen =
- hstoreCheckKeyLen(VARSIZE(in_datums[i * 2]) - VARHDRSZ);
+ hstoreCheckKeyLen(VARSIZE(DatumGetPointer(in_datums[i * 2])) - VARHDRSZ);
pairs[i].vallen =
- hstoreCheckValLen(VARSIZE(in_datums[i * 2 + 1]) - VARHDRSZ);
+ hstoreCheckValLen(VARSIZE(DatumGetPointer(in_datums[i * 2 + 1])) - VARHDRSZ);
pairs[i].isnull = false;
pairs[i].needfree = false;
}
diff --git a/contrib/hstore/hstore_op.c b/contrib/hstore/hstore_op.c
index 5e57eceffc8..bcba75f9258 100644
--- a/contrib/hstore/hstore_op.c
+++ b/contrib/hstore/hstore_op.c
@@ -107,8 +107,8 @@ hstoreArrayToPairs(ArrayType *a, int *npairs)
{
if (!key_nulls[i])
{
- key_pairs[j].key = VARDATA(key_datums[i]);
- key_pairs[j].keylen = VARSIZE(key_datums[i]) - VARHDRSZ;
+ key_pairs[j].key = VARDATA(DatumGetPointer(key_datums[i]));
+ key_pairs[j].keylen = VARSIZE(DatumGetPointer(key_datums[i])) - VARHDRSZ;
key_pairs[j].val = NULL;
key_pairs[j].vallen = 0;
key_pairs[j].needfree = 0;