From: "Xiao Meng" on
A problem here is that _create_hash_desc is called many times to
create a TupleDesc with int32 attribute.
I've tried to implement the function like this ,
TupleDesc _create_hash_desc()
{
static bool firstcall = true;
static TupleDesc tupdesc;
if(firstcall){
tupdesc = CreateTemplateTupleDesc(1, false);
TupleDescInitEntry(tupdesc, 1, "hashcode", INT4OID, -1, 0);
}
firstcall = false;
return tupdesc;
}

but it failed because tupdesc is free later, IMHO.
Any advice?

--
Best Regards,
Xiao Meng

DKERC, Harbin Institute of Technology, China
Gtalk: mx.cogito(a)gmail.com
MSN: cnEnder(a)live.com
http://xiaomeng.yo2.cn

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers