From d0e17e211230d37f26843711115864a87d0eae18 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 22 Jul 2000 03:34:43 +0000 Subject: Arrays are toastable. (At least if you initdb, which I didn't force.) Remove a bunch of crufty code for large-object-based arrays, which is superseded by TOAST and likely hasn't worked in a long time anyway. Clean up array code a little, and in particular eliminate its habit of scribbling on the input array (ie, modifying the input tuple :-(). --- contrib/array/array_iterator.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'contrib/array/array_iterator.c') diff --git a/contrib/array/array_iterator.c b/contrib/array/array_iterator.c index 447d5c6443e..c480f7dfc70 100644 --- a/contrib/array/array_iterator.c +++ b/contrib/array/array_iterator.c @@ -47,15 +47,18 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType *array, Datum value) FmgrInfo finfo; /* Sanity checks */ - if ((array == (ArrayType *) NULL) - || (ARR_IS_LO(array) == true)) + if (array == (ArrayType *) NULL) { /* elog(NOTICE, "array_iterator: array is null"); */ return (0); } + + /* detoast input if necessary */ + array = DatumGetArrayTypeP(PointerGetDatum(array)); + ndim = ARR_NDIM(array); dim = ARR_DIMS(array); - nitems = getNitems(ndim, dim); + nitems = ArrayGetNItems(ndim, dim); if (nitems == 0) { /* elog(NOTICE, "array_iterator: nitems = 0"); */ -- cgit v1.2.3