Hi!
On Mon, Aug 22, 2011 at 2:54 PM, Misa Simic
<misa.simic@gmail.com> wrote:
static int
m4_uuidkey_cmp(const void *a, const void *b)
{
uuidKEY *ia = (uuidKEY *) (((Usrt *) a)->t);
uuidKEY *ib = (uuidKEY *) (((Usrt *) b)->t);
int res;
res = DatumGetInt32(DirectFunctionCall2(uuid_cmp, UUIDPGetDatum(ia->upper), UUIDPGetDatum(ia->upper)));
if (res == 0)
return DatumGetInt32(DirectFunctionCall2(uuid_cmp, UUIDPGetDatum(ia->upper), UUIDPGetDatum(ib->upper)));
return res;
}
Getting error: aggregate error used where an integer was expected!
Seems that you need the address-of operator before ia->upper and ia->lower (likely one of operands should be "ia->lower"). UUIDPGetDatum except pointer as an argument, i.e. UUIDPGetDatum(&ia->upper).
It would be a lot appreciated if anyone could help me and suggest the best way to make Gist support for UUID datatype...
I think you're on the right way. btree_gist is an extension which provides GiST indexing of scalar datatype. UUID is one of them. So, the module you are writing should be quite similar.
------
With best regards,
Alexander Korotkov.