On Fri, Sep 25, 2015 at 7:41 PM, Teodor Sigaev <teo...@sigaev.ru> wrote:
> I'm OK about continuing work on amvalidate if we can build consuensus on
>> its design.
>> Could you give some feedback on amvalidate version of patch please?
> In attach a bit modified patch based on 4-th version, and if there are no
> strong objections, I will commit it. Waiting this patch stops Alexander's
> development on CREATE ACCESS METHOD and he needs to move forward.
+ IndexAmRoutine *result, *tmp;
+ result = (IndexAmRoutine *)MemoryContextAlloc(CacheMemoryContext,
+ tmp = (IndexAmRoutine *)DatumGetPointer(
+ memcpy(result, tmp, sizeof(IndexAmRoutine));
+ relation->amroutine = result;
Is it appropriate to use CacheMemoryContext here?
Currently in load_relcache_init_file(), all the other information
like rd_indoption, rd_aminfo in Relation is allocated in indexcxt
which ofcourse in allocated in CacheMemoryContext, but still is
there a reason why this also shouldn't be allocated in same
- aform = (Form_pg_am) MemoryContextAlloc(CacheMemoryContext, sizeof
+ aform = (Form_pg_am)MemoryContextAlloc(CacheMemoryContext, sizeof *aform);