> arrays using largely-similar code. But while intarray fails its
> regression test, I find ltree still passes. So I'm confused about what
> that code is really doing and don't want to touch it.
Please, apply attached patch, it solves the problem.
Teodor Sigaev
#include
+#include "catalog/pg_type.h"
#include "access/gist.h"
#include "access/itup.h"
#include "access/rtree.h"
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;