Thanks a lot so far. I adopted my structures and am now storing two fields (v_len_ and dimensions) and the storage is now working properly. If I now would try to combine two of these points to a range (like cube) including an upper and a lower bound n-dimensional point structure, I don't get the point how to achieve this. I tried around a little bit and ended up with a structure like the following: /** * basic structure definition for a range containing an upper and a lower point (in multiple dimensions) */ struct Range { int32 v_len_; /** * the upper limit in each dimension */ struct PointND * upper; /** * the lower limit in each dimension */ struct PointND * lower; }; However, the problem is again, how to put this range into a table. Actually, I don't know exactly, how to do this, I tried the following: len = VARSIZE(upper) + VARSIZE(lower) + VARHDRSZ + 2 * sizeof(struct Point *); result = (Range *) palloc0(len); // result->upper = upper; // result->lower = lower; memcpy((void *) result->upper, (void *) upper, VARSIZE(upper)); memcpy((void *) result->lower, (void *) lower, VARSIZE(lower)); // set the var size SET_VARSIZE(result, len); But this didn't do the trick. I did not yet find sth in the code of postgres, how to build such a combined type, unfortunately (or I did not look at the right places until now). How would one do this? Thanks in advance regards Carsten Kropf Am 10.02.2010 um 12:20 schrieb Yeb Havinga:
|