From 2f0f7b4bce13e68394543728801ef011fd82fac6 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 17 Apr 2008 21:37:28 +0000 Subject: Clean up a few places where Datums were being treated as pointers (and vice versa) without going through DatumGetPointer. Gavin Sherry, with Feng Tian. --- src/backend/access/common/indextuple.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/backend/access/common/indextuple.c') 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]); -- cgit v1.2.3