diff --git a/contrib/intarray/_int.c b/contrib/intarray/_int.c index f4fc63d1c1..65693a89f3 100644 --- a/contrib/intarray/_int.c +++ b/contrib/intarray/_int.c @@ -14,6 +14,7 @@ #include +#include "catalog/pg_type.h" #include "access/gist.h" #include "access/itup.h" #include "access/rtree.h" @@ -919,8 +920,10 @@ new_intArrayType(int num) r = (ArrayType *) palloc(nbytes); MemSet(r, 0, nbytes); - r->size = nbytes; - r->ndim = NDIM; + + ARR_SIZE(r) = nbytes; + ARR_NDIM(r) = NDIM; + ARR_ELEMTYPE(r) = INT4OID; r->flags &= ~LEAFKEY; *((int *) ARR_DIMS(r)) = num; *((int *) ARR_LBOUND(r)) = 1;