Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd - Mailing list pgsql-hackers

From Andy Fan
Subject Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd
Date
Msg-id CAKU4AWr2s2=OHd-KF-HvgaXGmHFDLHW=sf7sKpc1824zrnwnNQ@mail.gmail.com
Whole thread Raw
In response to Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd  (Andy Fan <zhihui.fan1213@gmail.com>)
Responses Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd
List pgsql-hackers
 
Why do you think this ought to be in the relcache, and not in the
executor's rangetable-associated data structures?

I re-think about this,  I guess I didn't mention something  clear enough.
That's true that I bound my bala struct to Relation struct, and the memory
relation used  is allocated in relcache.  but the memory of bala is allocated in
TopTransactionMemory context.  

xxx_table_tuple_insert(Relation rel, ...)
{
   if (rel->balabala == NULL)
        rel->balabala = allocate_bala_resource(rel);  //  TopTransactionContext.
   do_task_with(rel->balabala); 
}

not sure if this should be called as putting my data in relcache. 

and I rechecked the RelationData struct, and it looks like some Executor-bind struct also
resides in it. for example: RelationData.rd_lookInfo.  If the relcache can be reset, the 
fields like this are unsafe to access as well.  Am I missing something? 

--
Best Regards
Andy Fan

pgsql-hackers by date:

Previous
From: Andy Fan
Date:
Subject: Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd
Next
From: Greg Nancarrow
Date:
Subject: Re: Correct handling of blank/commented lines in PSQL interactive-mode history