Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd

From: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd
Date: 2021-11-30 01:14:06
Message-ID: CAKU4AWr2s2=OHd-KF-HvgaXGmHFDLHW=sf7sKpc1824zrnwnNQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

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