aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/common/indextuple.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2008-04-17 21:37:28 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2008-04-17 21:37:28 +0000
commit2f0f7b4bce13e68394543728801ef011fd82fac6 (patch)
tree0a8d0a662ac316ac07f33e10cd607ca0a49eac25 /src/backend/access/common/indextuple.c
parent25e46a504b215fb7e11463d628d3477098323367 (diff)
downloadpostgresql-2f0f7b4bce13e68394543728801ef011fd82fac6.tar.gz
postgresql-2f0f7b4bce13e68394543728801ef011fd82fac6.zip
Clean up a few places where Datums were being treated as pointers (and vice
versa) without going through DatumGetPointer. Gavin Sherry, with Feng Tian.
Diffstat (limited to 'src/backend/access/common/indextuple.c')
-rw-r--r--src/backend/access/common/indextuple.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/access/common/indextuple.c b/src/backend/access/common/indextuple.c
index 06bae46fbd1..9aa320a4351 100644
--- a/src/backend/access/common/indextuple.c
+++ b/src/backend/access/common/indextuple.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/common/indextuple.c,v 1.85 2008/01/01 19:45:45 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/common/indextuple.c,v 1.86 2008/04/17 21:37:28 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@@ -73,7 +73,7 @@ index_form_tuple(TupleDesc tupleDescriptor,
* If value is stored EXTERNAL, must fetch it so we are not depending
* on outside storage. This should be improved someday.
*/
- if (VARATT_IS_EXTERNAL(values[i]))
+ if (VARATT_IS_EXTERNAL(DatumGetPointer(values[i])))
{
untoasted_values[i] =
PointerGetDatum(heap_tuple_fetch_attr((struct varlena *)
@@ -85,8 +85,8 @@ index_form_tuple(TupleDesc tupleDescriptor,
* If value is above size target, and is of a compressible datatype,
* try to compress it in-line.
*/
- if (!VARATT_IS_EXTENDED(untoasted_values[i]) &&
- VARSIZE(untoasted_values[i]) > TOAST_INDEX_TARGET &&
+ if (!VARATT_IS_EXTENDED(DatumGetPointer(untoasted_values[i])) &&
+ VARSIZE(DatumGetPointer(untoasted_values[i])) > TOAST_INDEX_TARGET &&
(att->attstorage == 'x' || att->attstorage == 'm'))
{
Datum cvalue = toast_compress_datum(untoasted_values[i]);