Re: gsoc, store hash index tuple with hash code only - Mailing list pgsql-hackers

From Xiao Meng
Subject Re: gsoc, store hash index tuple with hash code only
Date
Msg-id ded849dd0807160329y456b6bbcj6270f7ad50459da0@mail.gmail.com
Whole thread Raw
In response to Re: gsoc, store hash index tuple with hash code only  ("Xiao Meng" <mx.cogito@gmail.com>)
List pgsql-hackers
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@gmail.com
MSN: cnEnder@live.com
http://xiaomeng.yo2.cn


pgsql-hackers by date:

Previous
From: "Xiao Meng"
Date:
Subject: Re: gsoc, store hash index tuple with hash code only
Next
From: daveg
Date:
Subject: Re: [PATCHES] pg_dump lock timeout