diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-07-22 03:34:43 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-07-22 03:34:43 +0000 |
commit | d0e17e211230d37f26843711115864a87d0eae18 (patch) | |
tree | b039e4879d7faeb1ddfc33f6051af4b21fbc3ce4 /contrib/array/array_iterator.c | |
parent | ec37ea1cc1356f1a0b7dad1d9e4933e50bea583f (diff) | |
download | postgresql-d0e17e211230d37f26843711115864a87d0eae18.tar.gz postgresql-d0e17e211230d37f26843711115864a87d0eae18.zip |
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 :-().
Diffstat (limited to 'contrib/array/array_iterator.c')
-rw-r--r-- | contrib/array/array_iterator.c | 9 |
1 files changed, 6 insertions, 3 deletions
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"); */ |